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

#1 2007-05-16 09:03:29

Dthen
Scratcher
Registered: 2007-05-16
Posts: 26

Spaceship moving problem.

Best i could describe it. Ok i'll try and be clear.

Basically, i'm trying to create a space ship kinda game.
I have two costumes, one for a stationary ship, one for a moving ship.
However, I cannot find how to make it change back to the first costume once the up (movement) key is released, without it flashing between them whilst the ship is moving.


Any help would be greatly appreciated.
Thanks in advance,

Dthen.

Offline

 

#2 2007-05-16 10:00:58

rszrama
Scratcher
Registered: 2007-05-15
Posts: 25

Re: Spaceship moving problem.

You can set up your controls something like this:

if key down arrow pressed
-change the costume
-repeat until not key down arrow pressed
--move the ship (I suggest using a variable to store the ship's speed)
change the costume back
end script

(The dashes show how to nest the logic... if that makes sense.  wink

Offline

 

#3 2007-05-16 10:46:11

Dthen
Scratcher
Registered: 2007-05-16
Posts: 26

Re: Spaceship moving problem.

Thanks, only... Can't find this... "not" thing....

Offline

 

#4 2007-05-16 14:49:12

rszrama
Scratcher
Registered: 2007-05-15
Posts: 25

Re: Spaceship moving problem.

Ooohh... yeah, it's tricky.  I only kept looking for it because someone told me it existed.   wink   I finally found it in the numbers section of commands.  It's a green box with pointy sides.

Offline

 

#5 2007-05-16 15:00:21

Dthen
Scratcher
Registered: 2007-05-16
Posts: 26

Re: Spaceship moving problem.

=O thankyou! what the hell is it doing in the numbers bit?

Offline

 

#6 2007-05-16 23:04:39

rszrama
Scratcher
Registered: 2007-05-15
Posts: 25

Re: Spaceship moving problem.

hehe  It's a logic thing, which I guess is technically looking for a 0 or non-zero.  Numbers wasn't the first place I looked for it, but I'm not sure where else it could go.  : P

Maybe because it's detecting logic it could better go in sensing?  But then it doesn't really fit with the rest of the sensing things either.

Offline

 

#7 2007-05-17 05:23:25

Dthen
Scratcher
Registered: 2007-05-16
Posts: 26

Re: Spaceship moving problem.

I suppose =/


thanks for your help btw  smile

Offline

 

#8 2007-05-21 16:11:11

dmagee
Scratcher
Registered: 2007-05-17
Posts: 13

Re: Spaceship moving problem.

Check out my project http://scratch.mit.edu/projects/dmagee/5670

It has a way of making the ship look like it is using rockets. Its a very simple technique that looks good.

Last edited by dmagee (2007-05-21 16:11:44)

Offline

 

Board footer