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

#1 2012-11-15 12:11:47

Rafeki
New Scratcher
Registered: 2012-10-25
Posts: 2

How to Jump off a Solid Block?

So right now im making  a mario game and I'm using yVelocity variable to simulate gravity. The problem though is when i jump on a brick the gravity pulls him through it or if I ever get him to stay on top he cant jump off of it for some reason? Im somehwat new to scratch but i have the basics down I just cant figure this out. Sry that this isnt very descriptive.

Offline

 

#2 2012-11-15 17:04:37

fillergames
Scratcher
Registered: 2012-10-15
Posts: 1000+

Re: How to Jump off a Solid Block?

Rafeki wrote:

So right now im making  a mario game and I'm using yVelocity variable to simulate gravity. The problem though is when i jump on a brick the gravity pulls him through it or if I ever get him to stay on top he cant jump off of it for some reason? Im somehwat new to scratch but i have the basics down I just cant figure this out. Sry that this isnt very descriptive.

Make it so that when the player is not touching the floor the Y velocity dosent change.


http://i50.tinypic.com/2ufvxc5_th.gif Grammer? Whats grammar?

Offline

 

#3 2012-11-17 12:34:52

30-1
Scratcher
Registered: 2012-08-08
Posts: 100+

Re: How to Jump off a Solid Block?

fillergames wrote:

Rafeki wrote:

So right now im making  a mario game and I'm using yVelocity variable to simulate gravity. The problem though is when i jump on a brick the gravity pulls him through it or if I ever get him to stay on top he cant jump off of it for some reason? Im somehwat new to scratch but i have the basics down I just cant figure this out. Sry that this isnt very descriptive.

Make it so that when the player is not touching the floor the Y velocity dosent change.

Or try making yvelocity change by 1 when it hits the floor.


http://i.imgur.com/ocOya7x.gif
I. Text I Based I Games I

Offline

 

#4 2012-11-17 16:21:10

awesomeness321
Scratcher
Registered: 2012-08-10
Posts: 100+

Re: How to Jump off a Solid Block?

Try this.

when gf clicked
things that come before 'forever'
forever
whatever scripts you have for moving around
if <touching color [#000000]?>
if <key [up arrow v] pressed?>
jumping scripts go here
else
change [yv v] by (1)
end
else
gravity scripts go here


My newest project:http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=projects&amp;type=newest&amp;return=image&amp;num=1Color:#30F9A5 I am currently http://blocks.scratchr.org/API.php?user=awesomeness321&amp;action=onlineStatus&amp;type=text

Offline

 

Board footer