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

#1 2010-09-25 01:35:26

optyks
New Scratcher
Registered: 2010-09-05
Posts: 12

Platformer questions: interacting with platforms?

So my buddy and I are trying to figure out how to get a sprite from going through a platform and cant get it to work right... We can jump onto a platform but always walk through it... whats some code to make us not be able to? The touching [sprite] commands dont seem to work....

Offline

 

#2 2010-09-25 02:07:43

Sunrise-Moon
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: Platformer questions: interacting with platforms?

optyks wrote:

So my buddy and I are trying to figure out how to get a sprite from going through a platform and cant get it to work right... We can jump onto a platform but always walk through it... whats some code to make us not be able to? The touching [sprite] commands dont seem to work....

If you're not using velocity:
When flag clicked
Forever
if <not <touching [color (or your platform)]>
Change y by [-1 (experiment with this number)]
End if
End forever

If using velocity:
When flag clicked
Forever
if <not <touching [color (or your platform)]>
Set [yVelocity] to [0]
End if
End forever

Try those  big_smile .


http://i1067.photobucket.com/albums/u427/HulKDzN/RebornBlade.png

Offline

 

#3 2010-09-27 18:31:10

XX11Games
Scratcher
Registered: 2010-09-18
Posts: 6

Re: Platformer questions: interacting with platforms?

Try My games,  <a href='http://scratch.mit.edu/projects/XX11Games/1316875'><img src='http://scratch.mit.edu/static/projects/XX11Games/1316875_med.png' width='425' height='319' alt='Scratch Project'></a>

<a href='http://scratch.mit.edu/projects/XX11Games/1316853'><img src='http://scratch.mit.edu/static/projects/XX11Games/1316853_med.png' width='425' height='319' alt='Scratch Project'></a>

Offline

 

#4 2010-09-28 10:55:22

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: Platformer questions: interacting with platforms?

see this

http://scratch.mit.edu/projects/fireball123/940816

Very helpful!  wink


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#5 2010-10-03 01:13:49

wei2912
Scratcher
Registered: 2010-05-09
Posts: 100+

Re: Platformer questions: interacting with platforms?

Find a reliable good platformer base, like Olic32's one. It's awesome. I used it in my games.


Waiting for Scratch 2.0...

Offline

 

#6 2010-10-03 19:39:33

XX11Games
Scratcher
Registered: 2010-09-18
Posts: 6

Re: Platformer questions: interacting with platforms?

Look at my platform engines. They could help.

Offline

 

#7 2010-10-03 20:41:56

platform710
Scratcher
Registered: 2010-04-23
Posts: 100+

Re: Platformer questions: interacting with platforms?

optyks wrote:

So my buddy and I are trying to figure out how to get a sprite from going through a platform and cant get it to work right... We can jump onto a platform but always walk through it... whats some code to make us not be able to? The touching [sprite] commands dont seem to work....

what you could try is put a color on the front of the character, try to put it on the middle on the front. that will be your sensing, you can make it a similar color as the sprite so it blends in. then add a: <if <color of senser touching color:(of platforms)?>
move minus speed of movement.                                               

but when you program the arrow keys, make sure you point in the direction that it moves, or else it will go backwards in only 1 direction. hope that helps  big_smile


http://i54.tinypic.com/2wn8hnb.gif

Offline

 

#8 2010-10-10 12:34:36

CDscratcher79
New Scratcher
Registered: 2010-10-06
Posts: 5

Re: Platformer questions: interacting with platforms?

Ok im trying to make  a boss fight where pacman shoots lasers from his eyes and if they hit the ghost sprite he loses 10 out of 500 life. I'm using glide for the lasers and the glide stops when it gets on top of the ghost for 0.01 seconds then moves again. Now, the thing is the if touching color of ghost or if touching ghost sprite won't respond! I've tried everything I can think of! Suggestions would be greatly appreciated. Thanks

Offline

 

#9 2010-10-10 12:42:24

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Platformer questions: interacting with platforms?

I made this for someone else, but you can use it too if you credit me  smile . http://scratch.mit.edu/projects/kayybee/1337050

Offline

 

Board footer