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

#1 2012-07-03 13:49:32

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Platformer help!

I need a script that allows a sprite to jump off angles, as well as straight lines.
Help!


Get ready for domination of:  tongue

Offline

 

#2 2012-07-03 14:37:07

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Platformer help!

It depends, simple angles "45, 125 etc" or any angle?


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-07-03 14:52:01

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Offline

 

#4 2012-07-03 14:59:18

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Platformer help!

No, I want it to bounce off of any angle...


Get ready for domination of:  tongue

Offline

 

#5 2012-07-03 15:05:51

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Platformer help!

coolhogs wrote:

I need a script that allows a sprite to jump off angles, as well as straight lines.
Help!

By jump off angle, do you mean jump straight up from a slope, or do you mean jump perpendicular to the slope?


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#6 2012-07-03 15:14:45

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Platformer help!

He means perpendicular.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#7 2012-07-03 16:07:13

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Platformer help!

berberberber wrote:

He means perpendicular.

Yes, that's what I mean...


Get ready for domination of:  tongue

Offline

 

#8 2012-07-03 16:10:59

Wes64
Scratcher
Registered: 2011-08-19
Posts: 1000+

Re: Platformer help!

Well you could have some sort of sensor that rotates around until it detects the correct slope. Then you could easily retrieve the angle, and then have the player jump in that direction.


Experienced 2.0 Tester: Ask me questions!
Using Firefox 13.0, Flash plugin version 11.4.402.287, and Windows XP Professional.

Offline

 

#9 2012-07-03 16:13:38

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Platformer help!

I'm confused.

What scripts should I use.


Get ready for domination of:  tongue

Offline

 

#10 2012-07-03 21:01:13

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Platformer help!

Wes64 wrote:

Well you could have some sort of sensor that rotates around until it detects the correct slope. Then you could easily retrieve the angle, and then have the player jump in that direction.

Um...
What sensor should I use?
Circle sensor, square sensor, etc.?


Get ready for domination of:  tongue

Offline

 

#11 2012-07-03 21:13:17

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Platformer help!

like this:

a line sensor that rotates around the sprite.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#12 2012-07-04 12:58:56

coolhogs
Scratcher
Registered: 2011-07-26
Posts: 1000+

Re: Platformer help!

Oh, ok.

And how do I detect a slope?


Get ready for domination of:  tongue

Offline

 

#13 2012-07-04 13:12:09

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: Platformer help!

Okay.  So you have a detector with red on one end and blue on the other end.  It rotates until around you untilboth of them are touching the color of your ground.  Then, it stores the direction in a variable, and when you jump, you go in the opposite of that variable.


http://i47.tinypic.com/2iaa73k.png

Offline

 

Board footer