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

#1 2011-03-26 11:07:42

Shadowsonics
Scratcher
Registered: 2010-12-05
Posts: 1000+

How do you make a "wall?"

Like when a character moves, it hits a wall, and it can't move on. I can't do that. When my character moves, it goes right past the wall! How do I make a "wall?"


http://i.imgur.com/cIxkl.jpg

Offline

 

#2 2011-03-26 11:10:04

Shadowsonics
Scratcher
Registered: 2010-12-05
Posts: 1000+

Re: How do you make a "wall?"

bump.


http://i.imgur.com/cIxkl.jpg

Offline

 

#3 2011-03-26 11:11:46

Shadowsonics
Scratcher
Registered: 2010-12-05
Posts: 1000+

Re: How do you make a "wall?"

bump


http://i.imgur.com/cIxkl.jpg

Offline

 

#4 2011-03-26 11:16:17

GurkinC
Scratcher
Registered: 2009-11-30
Posts: 100+

Re: How do you make a "wall?"

The method to use will depend on your movement scripts, can you write them up here?


Try my latest game, Rolling 2, a 10-level platform game based around the gravity marble.

Offline

 

#5 2011-03-26 11:17:45

silvershine
Scratcher
Registered: 2010-11-21
Posts: 500+

Re: How do you make a "wall?"

The character should have this script:
[blocks]
<when green flag clicked>
<forever if><key[ right arrow ]pressed?>
<move( -3 )steps>
[/blocks]
(Do this for every direction)

Offline

 

#6 2011-03-26 11:20:18

Shadowsonics
Scratcher
Registered: 2010-12-05
Posts: 1000+

Re: How do you make a "wall?"

Ok, here is my movement script: <when I receive[ Now
<forever if><key[ left arrow ]pressed?>
<point in direction( -90 <move( 4 )steps>


http://i.imgur.com/cIxkl.jpg

Offline

 

#7 2011-03-26 11:30:58

GurkinC
Scratcher
Registered: 2009-11-30
Posts: 100+

Re: How do you make a "wall?"

The really easy way to do it would be to make it turn 90 degrees when touching the colour of your wall. Would that work for you, or do you need a different solution?


Try my latest game, Rolling 2, a 10-level platform game based around the gravity marble.

Offline

 

#8 2011-03-26 15:24:43

Shadowsonics
Scratcher
Registered: 2010-12-05
Posts: 1000+

Re: How do you make a "wall?"

GurkinC wrote:

The really easy way to do it would be to make it turn 90 degrees when touching the colour of your wall. Would that work for you, or do you need a different solution?

Thanks! I've got it all solved.


http://i.imgur.com/cIxkl.jpg

Offline

 

#9 2011-03-26 18:35:03

alfiaw
Scratcher
Registered: 2011-01-11
Posts: 51

Re: How do you make a "wall?"

How about using the [blocks]<touching[ [/blocks] block with "edge" in the drop-down menu?  I struggled with this recently when wanting a sprite to broadcast an event (and change the background) when it hit the wall.  You can see it if you choose the "yes" option in this project.  Good luck!

Last edited by alfiaw (2011-03-26 18:36:08)


Annie the Dog says, Check out my The EVOLUTION OF THE TAPIR! (Tapirs are almost as cute as me.)
http://www.plumsite.com/images/annie1.jpg

Offline

 

#10 2011-03-26 20:01:06

Venazard
Scratcher
Registered: 2009-12-15
Posts: 100+

Re: How do you make a "wall?"

i always do

<if><touching color[ color of wall ]
<change x by( -3/3 )


http://nitrostudios.weebly.com/uploads/6/8/1/2/6812574/1323469851.png

Offline

 

Board footer