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

#1 2012-04-16 13:30:59

Rocket-Moon
New Scratcher
Registered: 2012-04-16
Posts: 14

Platforms

Hi im having problems with platforms, im just creating a simple looking game, but i can't manage to keep the sprite on top of the floor when pressing the jumping key.
when [space] key pressed
forever
if [not(color [] is touching[])]
switch to costume [jumping 3]
change y by [-5]
end
end

Offline

 

#2 2012-04-16 17:01:19

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Platforms

Why are you moving your sprite down when it jumps?  Try this:

when [space v] key pressed
if<color [] is touching []?>
set [i v] to [0]
repeat until <<(i) > [5]> or <color [top color] is touching [ceiling]?>>
change y by (4)
change [i v] by [1]
end
repeat until <color [] is touching []?>
change y by (-4)
end
end

Last edited by MoreGamesNow (2012-04-16 17:01:34)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#3 2012-04-16 20:21:22

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: Platforms

MoreGamesNow wrote:

Why are you moving your sprite down when it jumps?  Try this:

when [space v] key pressed
if<color [] is touching []?>
set [i v] to [0]
repeat until <<(i) > [5]> or <color [top color] is touching [ceiling]?>>
change y by (4)
change [i v] by [1]
end
repeat until <color [] is touching []?>
change y by (-4)
end
end

If you have gimp, open the color picker and look at the HTML notation. Then you can actually insert a color by putting a # before it.

Offline

 

#4 2012-04-16 21:01:29

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Platforms

chanmanpartyman wrote:

If you have gimp, open the color picker and look at the HTML notation. Then you can actually insert a color by putting a # before it.

I don't know what colors he using to sense or what color the ground is.  Descriptive words would help more than colors  hmm


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2012-04-17 14:26:09

Rocket-Moon
New Scratcher
Registered: 2012-04-16
Posts: 14

Re: Platforms

IN my script im trying to use frames, at the moment it can jump fine and move fine, IT'S JUST THOSE * PLATFORMS. i have made soome previous games using a ball and it's fine. so i've decided to try using frames.

Offline

 

Board footer