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

#1 2011-06-28 07:59:26

Cloud444
Scratcher
Registered: 2011-06-24
Posts: 1

How do I make a Platform?

I need to know how to make a platform for my game.  yikes

Offline

 

#2 2011-06-28 11:00:21

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

Re: How do I make a Platform?

Well, the easiest way (assuming you already have gravity set up) is to make it so that it only falls if it's not touching the color that the platform is. A script might look like this:

Code:

when green flag clicked
Forever
    If <not <touching color (whichever)> >
        Change y by -5

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

 

#3 2011-06-28 11:40:06

chipguy
Scratcher
Registered: 2009-09-09
Posts: 500+

Re: How do I make a Platform?

i always use <if><touching color[ green ]>
<set{ gravity }to( 0 )>
<else><change{ gravity }by( 0.2 )
<end>

and at the end of the script say: change y by gravity.

that's what i use. it makes the character accelerate as he falls.


http://scratch.mit.edu/static/projects/chipguy/2919121_sm.png by yours truly  big_smile

Offline

 

Board footer