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

#1 2008-10-17 08:08:51

danieldk
Scratcher
Registered: 2008-10-14
Posts: 3

A blockage

Hi I'm new to Scratch and I am making a game that I'm really excited about!
I want to post it soon and show the world my creation!!!!  big_smile
So um... Anyways. I have a problem making it... Most of the things that I want are pretty much covered but I need one thing to finish the job.
I have a sprite that is going to walk and jump around... but I want a blockage thing.
Like there is a wall in front of him that he can't go through unless he does something... I know how to make the wall go away when he does something to open it but the problem is he can still walk trough it no matter what he needs to do!!!
I need help PLZ!!!!!!
If you didn't quite understand what I just said I want a wall to block a sprite from going through.


Thanks!



DK

Offline

 

#2 2008-10-17 12:52:05

Mayhem
Scratcher
Registered: 2007-05-26
Posts: 1000+

Re: A blockage

Whatever routine you are using to make your sprite walk forward, put in an "if" statement (using a sensor) that stops the walk-forward script from working if the sprite is touching the blockage.

EG:

When Up Arrow pressed
If NOT (touching sprite "Block"), move 10.

Last edited by Mayhem (2008-10-17 12:52:20)


Web-spinning Spider:  http://scratch.mit.edu/projects/Mayhem/18456
3D Dungeon Adventure:  http://scratch.mit.edu/projects/Mayhem/23570
Starfighter X: http://scratch.mit.edu/projects/Mayhem/21825
Wandering Knight: http://scratch.mit.edu/projects/Mayhem/28484

Offline

 

#3 2008-10-17 14:28:36

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: A blockage

If you want a more general-purpose solid walls technique - this one is pretty bullet proof:

http://scratch.mit.edu/projects/Paddle2SeeFixIt/188825


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer