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

#1 2012-10-24 11:40:01

qprmanharvey
New Scratcher
Registered: 2012-10-24
Posts: 3

Help with Platform Game

Hi, I have been working on a platform style game as part of my school project which also uses scroll y and velocity/jumping. I have been quite successful so far but seem to have hit a bit of a problem. When my sprite falls down, he ends up going through the platforms rather than landing on them. Any ideas on how I could edit my scripts or add scripts to stop this from happening. I have been reading up about sensors but not too sure if this would be solution. Any help would be much appreciated.

The link to the game is :

http://scratch.mit.edu/projects/qprmanharvey/2856912

Many thanks!

Offline

 

#2 2012-10-24 13:06:56

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Help with Platform Game

The platforms are black (so the player takes damage when touching them) and the color detection at the bottom of the scripts is looking for the wrong color.


when gf clicked

set [Y Velocity v] to [0]

forever  

if <key [up arrow v] pressed?> 

set [Y Velocity v] to [4]

change y by (Y Velocity)

repeat until <touching color [#00CE42]?>  

change y by (Y Velocity)

change [Y Velocity v] by (-0.2)

end

set [Y Velocity v] to [0]

end

if <touching color [#00CE42]?>

change y by (0)

else

change y by (-3)

end

if <touching color [#000001]?> 

reset timer

move (-10) steps

change [Health v] by (-1)

end

end

You'll either want to change the platforms to that color, or change the platform color and then change the colors in the script. The mismatched colors are the green ones.

Hope that helps.  smile

Offline

 

Board footer