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

#1 2010-01-19 16:08:21

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

How To Jump In A Game But Not Very High?

I'm still making my very first scrolling project, and I put this script:

Code:

<When Green Flag Clicked>
<forever if><key [up arrow] pressed]
<repeat (20)>
<change y by (10)>

That makes him stay up in the air if you press the up and right arrow keys at the same time, the sprite will stay up and it's going to make the whole game seem easy. Can someone help me?

Last edited by a1130 (2010-01-19 16:11:14)

Offline

 

#2 2010-01-19 16:17:34

wiimaster
Scratcher
Registered: 2008-09-17
Posts: 1000+

Re: How To Jump In A Game But Not Very High?

<When Green Flag Clicked>
<forever if<touching (color of ground)and<key [up arrow] pressed>
<repeat (20)>
<change y by (10)>

That should work.

Last edited by wiimaster (2010-01-19 16:18:05)


http://i584.photobucket.com/albums/ss286/wiimaster1/Wiimaster_zps107dca4c.gif

Offline

 

#3 2010-01-20 09:10:37

shamrocker
Scratcher
Registered: 2009-03-19
Posts: 1000+

Re: How To Jump In A Game But Not Very High?

ill look around... and then I'll link you to a thread which will help you with this.  smile


http://i46.tinypic.com/2s1b32e.png
respect the oxford comma

Offline

 

#4 2010-01-20 19:15:12

fg123
Scratcher
Registered: 2008-11-13
Posts: 1000+

Re: How To Jump In A Game But Not Very High?

Did you make it so if he isn't touching ground, go down?


Hai.

Offline

 

#5 2010-01-22 00:55:52

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

Re: How To Jump In A Game But Not Very High?

if your ground is flat just change your...
if><key [up arrow] pressed]
to
if     key [up arrow] pressed    and    Y < ???

just set ??? to a Y value just above the ground height, so if he is already in the air, it won't jump again or float


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

Offline

 

#6 2010-01-24 01:27:02

Lockinator483
Scratcher
Registered: 2010-01-14
Posts: 1

Re: How To Jump In A Game But Not Very High?

What you can do is this:

forever
if key [up arrow] pressed
repeat 10 times
change y by 10

And also do this:

forever
if not touching colour (whatever ground coulor u have)
change y by -5
if touching (ground colour)
change y by 5

That way you will fall when you jump off something and if you are in the ground you shoot back up!
Lemme know if this helps you.
big_smile

Offline

 

#7 2010-01-24 14:25:58

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: How To Jump In A Game But Not Very High?

Lockinator483 wrote:

What you can do is this:

forever
if key [up arrow] pressed
repeat 10 times
change y by 10

And also do this:

forever
if not touching colour (whatever ground coulor u have)
change y by -5
if touching (ground colour)
change y by 5

That way you will fall when you jump off something and if you are in the ground you shoot back up!
Lemme know if this helps you.
big_smile

Dude, if I do that, if I press the up arrow and the right arrow the guy will stay in the air. I don't want him to jump that high.

Offline

 

#8 2010-01-24 14:34:21

a1130
Scratcher
Registered: 2009-08-27
Posts: 500+

Re: How To Jump In A Game But Not Very High?

Here is my solution:

Code:

 {When Green Flag CLicked}
<forever if ([key up arrow pressed] and [touching color of ground])>
<repeat 20>
<change y by 10>

And (something like this, I can't really remember unless I open that project)
{When Green Flag Clicked}
[forever if (not {touching color of ground})]
[change y by -5]
And it's making it better and harder!

Offline

 

Board footer