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

#1 2009-02-20 17:12:52

Mike358
Scratcher
Registered: 2009-02-20
Posts: 11

Moving when you jump

I have been attempting to make a game where the character can move while he is jumping, but when I try he startes using the walking costumes. I can't seem tho figure out how to stop that from happening.  Does anyone know how?

Thanks!

Offline

 

#2 2009-02-20 17:29:16

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Moving when you jump

Try making two separate scripts for changing the costume and the jumping. Make a variable called "in air". Under the first block that makes you jump, make it set in air to 1, and when you land set in air to 0.

The costume changing scripts should look something like this:
<when green flag clicked>
<forever>
<if><( <{ in air }> <=> 0 )>
  [walking costumes]
<else>
  [jumping costumes]
<end>
<end>[/blocks]


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

#3 2009-02-22 08:01:12

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Moving when you jump

greenflag
forever
  if   (key[Left  ]pressed <or>key[ right ]pressed)
  [walking costume(s)]
  else
[standing costume(s)]
  end
end

Last edited by yambanshee (2009-02-22 08:03:36)

Offline

 

#4 2009-02-25 15:13:45

Mike358
Scratcher
Registered: 2009-02-20
Posts: 11

Re: Moving when you jump

Thanks for the help!

Offline

 

Board footer