loop’s race game - amazon s3 · loop’s race game in this game, loop is racing to reach the...

5
www.swopbots.com 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, LEFT very quickly! Take it in turns to race your friends and see who is the fastest. 1 Get the starter project here (contains Loop Running animation) Download for offline use : https://goo.gl/0eHpyY Online version : https://scratch.mit.edu/projects/154816948/ 2 Make a variable Go to Data Make a Variable Call it : canMove

Upload: others

Post on 26-Jun-2020

0 views

Category:

Documents


0 download

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