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
www.swopbots.com
ThecanMovevariableisusedtocheckifyouneedtopresstheLeftArrowKeyortheRightArrowKey.
3
Loop’sCode
SetLooptohisstartposition.
SetcanMoveto-1(thismeansLoopcannotmoveyet)
www.swopbots.com
WhenLeftArrowkeyispressed,wecheckifcanMove=1IfcanMove=1thenchangeLoop’scostume(tomakehimlooklikeheisrunning)MoveLoopby3stepsSetcanMoveto0(thismeansyounowneedtopresstheRightArrowKey)ThiscodeisrepeatedfortheRightArrowKeybutthistimecanMovemustequal0tomove.
4
CodeforViolum
www.swopbots.com
WhenGreenFlagisclickedSHOWtheviolumsprite.Checkforever…IftheviolumistouchingLoopthenitwillhideandthecodewillstoprunning(thiswillstopthetimer)
5
Makeanothervariable
NamethevariableTime
6StageCode
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