This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-06-04 12:38:42

Bungle
Scratcher
Registered: 2007-06-02
Posts: 2

Copter Game

For my first "project" in Scratch I thought i'd try and make a duplicate of the popular flash "Copter" game (as found here). The top/bottom blocks are quite basic, as I haven't yet figured out how to make their behaviour more like the original Copter (with different sizes), although I suspect I may have to use costumes in some way.

What I want to try and do next is instead of having a timer (duration flown for), I want to make it display a distance figure. The difference with the copter I have in Scratch is that the speed is settable (different speed settings so whoever uses it can adjust the speed to their machine, and also that speed is always quicker in the Scratch program anyway), so the copter can look like it's flying faster, so simply using a timer is slightly misguiding when you can choose how fast or slow to go.

What exactly would be the best way of doing that? Obviously i'd have to include the current speed variable in some way (maybe manuipulate the timer figure as well?). Another thought I had was simply to just keep adding on the speed figure to a variable, which of course would increase the number faster the higher the speed being played at. I can't seem to figure out the best way to go about it.

Offline

 

#2 2007-06-04 16:03:56

kevin_karplus
Scratcher
Registered: 2007-04-27
Posts: 1000+

Re: Copter Game

Have a variable "distance" and a loop:

repeat until <some exit condition>
     change distance by speed*0.1
     wait 0.1 seconds

Offline

 

#3 2007-06-05 11:52:26

Bungle
Scratcher
Registered: 2007-06-02
Posts: 2

Re: Copter Game

Many thanks for that, works a charm.

Offline

 

Board footer