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

#1 2011-01-24 09:16:43

TGKookie
Scratcher
Registered: 2010-12-03
Posts: 29

walls

how do i make my platformer man not go through walls?

Offline

 

#2 2011-01-24 14:28:39

Happypieman
Scratcher
Registered: 2010-09-28
Posts: 100+

Re: walls

You could use two options. One is, when your character is touching wall (you might want to make it a certain colour) then: if touching colour [] (the wall's colour) turn 180 degrees, move 20 steps. Another option is sensors, they are invisible different coloured lines that go in a square around your character. Now, i've never used them but from studying other peoples stuff, when the colour of the sensor is touching a wall or a floor, it sets a variable, usually xcollision for floors, ycollision for walls, to 1. When it is 1 it means that the sprite will stop moving down. This will only work if the sprite can move when x or ycollision is 0. You might want to go to the advanced topics and post a new topic on sensors. Hope this helps!  smile


2012--The biggest troll ever.

Offline

 

Board footer