Update icons and fix ZS builtin usage detection

This commit is contained in:
sam-astro 2022-01-29 19:11:42 -05:00
parent 2961caf207
commit fa7c6691da
7 changed files with 32 additions and 26 deletions

BIN
ZS-Icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
ZS-Icon.psd Normal file

Binary file not shown.

View File

@ -75,7 +75,7 @@
}
"Entry"
{
"MsmKey" = "8:_F1964A3FC0114E58A81978C4C7107596"
"MsmKey" = "8:_EF059CAB8D2A4444B8233E61C53F3349"
"OwnerKey" = "8:_UNDEFINED"
"MsmSig" = "8:_UNDEFINED"
}
@ -352,10 +352,10 @@
"IsDependency" = "11:FALSE"
"IsolateTo" = "8:"
}
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_F1964A3FC0114E58A81978C4C7107596"
"{1FB2D0AE-D3B9-43D4-B9DD-F88EC61E35DE}:_EF059CAB8D2A4444B8233E61C53F3349"
{
"SourcePath" = "8:..\\Releases\\ZSharp-Win-x64\\Pong-Example-Project\\script.slg"
"TargetName" = "8:script.slg"
"SourcePath" = "8:..\\Releases\\ZSharp-Win-x64\\Pong-Example-Project\\script.zs"
"TargetName" = "8:script.zs"
"Tag" = "8:"
"Folder" = "8:_AB72F4F4665144CA990532BBC3679E36"
"Condition" = "8:"
@ -459,15 +459,15 @@
{
"Name" = "8:Microsoft Visual Studio"
"ProductName" = "8:ZSharp"
"ProductCode" = "8:{4E83312A-4C42-44BD-8604-E55F7D1B005B}"
"PackageCode" = "8:{A82E7BE4-0442-482B-A5CB-CC097C9915DF}"
"ProductCode" = "8:{E0DBFA73-DB3D-45D9-8CF3-72E965B6029B}"
"PackageCode" = "8:{F096C1DE-0546-4388-90EC-8AB800FA4D52}"
"UpgradeCode" = "8:{8ABDE53F-7FF9-455B-A777-B4C1C624FA13}"
"AspNetVersion" = "8:2.0.50727.0"
"RestartWWWService" = "11:FALSE"
"RemovePreviousVersions" = "11:TRUE"
"DetectNewerInstalledVersion" = "11:TRUE"
"InstallAllUsers" = "11:FALSE"
"ProductVersion" = "8:1.3.0"
"ProductVersion" = "8:1.3.1"
"Manufacturer" = "8:Sam-Astro"
"ARPHELPTELEPHONE" = "8:"
"ARPHELPLINK" = "8:"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 KiB

After

Width:  |  Height:  |  Size: 800 KiB

View File

@ -116,7 +116,7 @@ bool IsFunction(const string& funcName)
}
bool IsZSFunction(const string& funcName)
{
if (funcName[0] == 'S' && funcName[1] == 'L' && funcName[2] == 'B' && funcName[3] == '.')
if (funcName[0] == 'Z' && funcName[1] == 'S' && funcName[2] == '.')
return true;
else
return false;
@ -385,7 +385,7 @@ boost::any ProcessLine(const vector<vector<string>>& words, int lineNum, unorder
return EvalExpression(unWrapVec(vector<string>(words.at(lineNum).begin() + 1, words.at(lineNum).end())), variableValues);
// Check if it is ZS Builtin function
else if (words.at(lineNum).at(0)[0] == 'S' && words.at(lineNum).at(0)[1] == 'L' && words.at(lineNum).at(0)[2] == 'B' && words.at(lineNum).at(0)[3] == '.')
else if (words.at(lineNum).at(0)[0] == 'Z' && words.at(lineNum).at(0)[1] == 'S' && words.at(lineNum).at(0)[2] == '.')
return EvalExpression(unWrapVec(words.at(lineNum)), variableValues);
// Check if it is function
@ -735,5 +735,11 @@ int main(int argc, char* argv[])
#endif
parseZSharp(scriptTextContents);
#if DEVELOPER_MESSAGES
cout << "Press Enter to Continue";
cin.ignore();
exit(1);
#endif
return 0;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 800 KiB

After

Width:  |  Height:  |  Size: 800 KiB

View File

@ -13,11 +13,11 @@ float lerpSpeed = 14
bool aiOn = false
// Main is always run at the VERY BEGINNING. Start() is the start of GRAPHICS
// so if you never call SLB.Grapgics.Init, then Start won't run
// so if you never call ZS.Grapgics.Init, then Start won't run
func Main()
{
// Immediately creates the window, then Start(), then the game loop. The game loop calls Update() every frame
SLB.Graphics.Init("This is a pong game", SCREENW, SCREENH)
ZS.Graphics.Init("This is a pong game", SCREENW, SCREENH)
}
func Start()
@ -39,22 +39,22 @@ func Start()
Vec2 rPaddlePosition = NVec2(rOffset, yPosPaddle)
global Vec2 rPaddleTargetPosition = NVec2(rOffset, yPosPaddle)
global Sprite ballSpr = SLB.Graphics.Sprite("./square.png", ballPos, ballScale, 0)
global Sprite lPaddle = SLB.Graphics.Sprite("./square.png", lPaddlePosition, paddleScale, 0)
global Sprite rPaddle = SLB.Graphics.Sprite("./square.png", rPaddlePosition, paddleScale, 0)
global Sprite ballSpr = ZS.Graphics.Sprite("./square.png", ballPos, ballScale, 0)
global Sprite lPaddle = ZS.Graphics.Sprite("./square.png", lPaddlePosition, paddleScale, 0)
global Sprite rPaddle = ZS.Graphics.Sprite("./square.png", rPaddlePosition, paddleScale, 0)
Vec2 netScale = NVec2(1, SCREENH)
global Sprite net = SLB.Graphics.Sprite("./net.png", centerOfScreen, netScale, 0)
global Sprite net = ZS.Graphics.Sprite("./net.png", centerOfScreen, netScale, 0)
float leftOffset = SCREENW / 4
Vec2 scoreOnePos = NVec2(leftOffset, 30)
global Text scoreTextOne = SLB.Graphics.Text("0", "./arial.ttf", scoreOnePos, 60, 0, 255, 255, 255)
global Text scoreTextOne = ZS.Graphics.Text("0", "./arial.ttf", scoreOnePos, 60, 0, 255, 255, 255)
float rightOffset = SCREENW - (SCREENW / 4)
Vec2 scoreTwoPos = NVec2(rightOffset, 30)
global Text scoreTextTwo = SLB.Graphics.Text("0", "./arial.ttf", scoreTwoPos, 60, 0, 255, 255, 255)
global Text scoreTextTwo = ZS.Graphics.Text("0", "./arial.ttf", scoreTwoPos, 60, 0, 255, 255, 255)
Vec2 instructionsPos = NVec2(centerOfScreen.x, SCREENH - 60)
global Text instructionsText = SLB.Graphics.Text("Use 'W' and 'S' or 'UP' and 'DOWN' arrows to control or press 'ENTER' to toggle AI", "./arial.ttf", instructionsPos, 20, 0, 255, 255, 255)
global Text instructionsText = ZS.Graphics.Text("Use 'W' and 'S' or 'UP' and 'DOWN' arrows to control or press 'ENTER' to toggle AI", "./arial.ttf", instructionsPos, 20, 0, 255, 255, 255)
global Vec2 ballVelocity = NVec2(ballSpeed, ballSpeed)
}
@ -156,16 +156,16 @@ func Update(deltaTime)
ballSpr.position += scaledVelocity
// Finally draws all of the sprites
SLB.Graphics.Draw(ballSpr)
SLB.Graphics.Draw(lPaddle)
SLB.Graphics.Draw(rPaddle)
ZS.Graphics.Draw(ballSpr)
ZS.Graphics.Draw(lPaddle)
ZS.Graphics.Draw(rPaddle)
SLB.Graphics.Draw(net)
ZS.Graphics.Draw(net)
SLB.Graphics.DrawText(scoreTextOne)
SLB.Graphics.DrawText(scoreTextTwo)
ZS.Graphics.DrawText(scoreTextOne)
ZS.Graphics.DrawText(scoreTextTwo)
SLB.Graphics.DrawText(instructionsText)
ZS.Graphics.DrawText(instructionsText)
HandleBallBounce()
}
@ -256,6 +256,6 @@ func HandleBallBounce()
func Colliding(a, b)
{
bool b = SLB.Physics.AxisAlignedCollision(a, b)
bool b = ZS.Physics.AxisAlignedCollision(a, b)
return b
}