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,

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,

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,

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,

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,

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


Top Related