loop’s race game - amazon s3 · loop’s race game in this game, loop is racing to reach the...
TRANSCRIPT
![Page 1: Loop’s Race Game - Amazon S3 · Loop’s Race Game In this game, Loop is racing to reach the violum. To run, use the Right and Left Arrow Keys. You need to press RIGHT, LEFT, RIGHT,](https://reader034.vdocuments.us/reader034/viewer/2022042323/5f0e3c1e7e708231d43e4278/html5/thumbnails/1.jpg)
www.swopbots.com
Loop’sRaceGame
Inthisgame,Loopisracingtoreachtheviolum.Torun,usetheRightandLeftArrowKeys.
YouneedtopressRIGHT,LEFT,RIGHT,LEFTveryquickly!
Takeitinturnstoraceyourfriendsandseewhoisthefastest.1
Getthestarterprojecthere(containsLoopRunninganimation)
Downloadforofflineuse:https://goo.gl/0eHpyY
Onlineversion:https://scratch.mit.edu/projects/154816948/
2Makeavariable
GotoDataMakeaVariableCallit:canMove
![Page 2: Loop’s Race Game - Amazon S3 · Loop’s Race Game In this game, Loop is racing to reach the violum. To run, use the Right and Left Arrow Keys. You need to press RIGHT, LEFT, RIGHT,](https://reader034.vdocuments.us/reader034/viewer/2022042323/5f0e3c1e7e708231d43e4278/html5/thumbnails/2.jpg)
www.swopbots.com
ThecanMovevariableisusedtocheckifyouneedtopresstheLeftArrowKeyortheRightArrowKey.
3
Loop’sCode
SetLooptohisstartposition.
SetcanMoveto-1(thismeansLoopcannotmoveyet)
![Page 3: Loop’s Race Game - Amazon S3 · Loop’s Race Game In this game, Loop is racing to reach the violum. To run, use the Right and Left Arrow Keys. You need to press RIGHT, LEFT, RIGHT,](https://reader034.vdocuments.us/reader034/viewer/2022042323/5f0e3c1e7e708231d43e4278/html5/thumbnails/3.jpg)
www.swopbots.com
WhenLeftArrowkeyispressed,wecheckifcanMove=1IfcanMove=1thenchangeLoop’scostume(tomakehimlooklikeheisrunning)MoveLoopby3stepsSetcanMoveto0(thismeansyounowneedtopresstheRightArrowKey)ThiscodeisrepeatedfortheRightArrowKeybutthistimecanMovemustequal0tomove.
4
CodeforViolum
![Page 4: Loop’s Race Game - Amazon S3 · Loop’s Race Game In this game, Loop is racing to reach the violum. To run, use the Right and Left Arrow Keys. You need to press RIGHT, LEFT, RIGHT,](https://reader034.vdocuments.us/reader034/viewer/2022042323/5f0e3c1e7e708231d43e4278/html5/thumbnails/4.jpg)
www.swopbots.com
WhenGreenFlagisclickedSHOWtheviolumsprite.Checkforever…IftheviolumistouchingLoopthenitwillhideandthecodewillstoprunning(thiswillstopthetimer)
5
Makeanothervariable
NamethevariableTime
6StageCode
![Page 5: Loop’s Race Game - Amazon S3 · Loop’s Race Game In this game, Loop is racing to reach the violum. To run, use the Right and Left Arrow Keys. You need to press RIGHT, LEFT, RIGHT,](https://reader034.vdocuments.us/reader034/viewer/2022042323/5f0e3c1e7e708231d43e4278/html5/thumbnails/5.jpg)
www.swopbots.com
SettheTimeto5
Firststepistocountdownfrom5seconds
After5secondsthegamebegins
SetcanMoveto0(thismeansyouneedtopressthe
RightArrowKeytorun)
Thetimewillnowcountupby0.1everyonetenthofasecond
WellDone….Yourgameisreadytoplay!
Links:
CompletedProject:https://scratch.mit.edu/projects/154816513/
CanyouchangeLoop’sspeed?Canyoumakethegame2player?MaybeLoopcouldberacingSwitch…Canyouaddpower-upsthatappearrandomly?MaybeLoopcouldcollectaspeedboost…Canyoumakethegame2player?
Cody’schallenges