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

#1 2010-07-16 21:49:06

bobobobobiy
New Scratcher
Registered: 2010-07-16
Posts: 1

making ground

How do I make solid ground that the sprite doesn't fall through?

Offline

 

#2 2010-07-16 21:55:37

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: making ground

Maybe this topic could help you out: here. It's primary concern is gravity, though it also makes it so that you won't go through the floor.

Good luck!

Offline

 

#3 2010-07-17 09:14:28

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: making ground

I'm not sure you have your answer yet, so here is what I do. Say that you want SPACE to make you jump. So you write
<when[ SPACE ]key pressed>
<if> <touching ground>
<change y by( 25).
<end>
Look at next post (continued)

Last edited by MoreGamesNow (2010-07-17 09:17:39)


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2010-07-17 09:16:33

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: making ground

Then you write
<when green flag clicked>
<forever if> Not <touching ground>
<change y by( -2
<end>


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#5 2010-07-17 09:18:56

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: making ground

The results of both these scripts: When Sprite1 (the moving sprite) is touching the ground and SPACE is pressed, he jumps up. When he's not touching the ground he falls. Hope this helps.


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#6 2010-07-17 10:56:42

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

Re: making ground

MoreGamesNow wrote:

The results of both these scripts: When Sprite1 (the moving sprite) is touching the ground and SPACE is pressed, he jumps up. When he's not touching the ground he falls. Hope this helps.

Note that ground is a sprite here.


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

Offline

 

#7 2010-07-17 11:23:17

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

Re: making ground

We should develop a flow-chart type image, with different methods split by different game/project requirements. And then repeat for collision detection, scrolling...  smile


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

Offline

 

Board footer