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

#1 2010-07-04 06:10:26

Gveradux
Scratcher
Registered: 2010-06-18
Posts: 100+

Need jumping on uneven platform script

Hi, I need a script that will allow me to jmp on uneven platforms. plz help.

Eg.

Even:

______________________________
______________________________

Uneven:

_     - _     ___________     _______            __
_ ____ _________             ___________________

Offline

 

#2 2010-07-04 06:22:47

meew0
Scratcher
Registered: 2010-02-22
Posts: 1000+

Re: Need jumping on uneven platform script

Just search for "Perfect Platformer Engine" in the search box.


http://i.imgur.com/mJV3j.pnghttp://i.imgur.com/HwWAX.pnghttp://i.imgur.com/sZ7Ui.pnghttp://i.imgur.com/0y6yh.pnghttp://i.imgur.com/nOC4l.png

Offline

 

#3 2010-07-05 21:40:15

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Need jumping on uneven platform script

So, you mean falling is dependent on touching the platform, not the y position? You can do that pretty easily by telling the y position to decrease unless touching a certain color. For example, if the platforms were green:
http://i48.tinypic.com/331o94k.gif
That's the basic premise!


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#4 2010-07-05 22:07:49

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Need jumping on uneven platform script

You could even combine "y position" and "color sensing" to make the sprites stay on top of platforms instead of stalling inside. Make a seperate block that continually checks the player's sprite against visible sprites to see which is closest. If touching color set y to closest sprites y. Then you could have platforms that move any which way and sprites always on top. Maybe, I dunno, just thinking out loud    >=P


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

#5 2010-07-05 22:20:06

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Need jumping on uneven platform script

Locomule wrote:

You could even combine "y position" and "color sensing" to make the sprites stay on top of platforms instead of stalling inside. Make a seperate block that continually checks the player's sprite against visible sprites to see which is closest. If touching color set y to closest sprites y. Then you could have platforms that move any which way and sprites always on top. Maybe, I dunno, just thinking out loud    >=P

Well, at that point, you might as well just make a sensor. I was just trying to give a solution that is easy to understand for a beginner.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2010-07-06 02:46:51

Chrischb
Scratcher
Registered: 2008-07-24
Posts: 1000+

Re: Need jumping on uneven platform script

meew0 wrote:

Just search for "Perfect Platformer Engine" in the search box.

Or click here - it's faster.  big_smile


I fall: It's a tragedy. You fall: It's comedy.
Hmph enjoy your fall - I get a lovely spring... without pans of new leaves.

Offline

 

#7 2010-07-06 13:22:27

waitin66
New Scratcher
Registered: 2010-07-06
Posts: 1

Re: Need jumping on uneven platform script

Just search for "Perfect Platformer Engine" in the search box.

Offline

 

#8 2010-07-09 14:58:11

Locomule
Scratcher
Registered: 2009-08-24
Posts: 500+

Re: Need jumping on uneven platform script

I updated mine, it was flat. Anyway it is uneven and moves up and down while you run around and jump on it.

here


aka Pain from DragonSpires, Delrith Online, BotBattle, Urban Dead etc etc lol

Offline

 

Board footer