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

#1 2011-06-26 22:09:33

itchyscratch33
Scratcher
Registered: 2011-04-23
Posts: 1

Need help making walls.

im making this RPG game wer ur guy follows around ur mouse but im having trouble making the guy NOT go thru my walls.  hmm

Offline

 

#2 2011-06-27 01:53:34

Jonathanpb
Scratcher
Registered: 2008-07-25
Posts: 1000+

Re: Need help making walls.

You could try making your player move right, and if it's touching a wall (which can be a sprite or color), it should 'bounce' back.


"Human beings... must have action; and they will make it if they cannot find it.
-Charlotte Brontë

Offline

 

#3 2011-06-27 10:12:55

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Need help making walls.

Here is the script:
http://i54.tinypic.com/308weae.gif


http://scratch.mit.edu/static/projects/henleyTest/1887529_sm.png
^^ Click that to see how it works online!  big_smile

EDIT: Change the color on the “if touching color” block to be the same color(s) as the walls.

Last edited by henley (2011-06-27 15:30:32)


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#4 2011-06-27 15:23:30

DigiTechs
Scratcher
Registered: 2011-04-30
Posts: 500+

Re: Need help making walls.

Or, like in the PacMan project in the games section on the program, you can have a certian colour as background and have a script like this:

[blocks]
<when green flag clicked>
<if><touching color[ background ]>
<move( 3 )steps>
[/blocks]

Im new to the scratch blocks, so if it dosent show, i really dont know


I'm back.
Maybe.

Offline

 

#5 2011-06-27 15:29:25

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Need help making walls.

DigiTechs wrote:

Or, like in the PacMan project in the games section on the program, you can have a certian colour as background and have a script like this:

[blocks]
<when green flag clicked>
<if><touching color[ background ]>
<move( 3 )steps>
[/blocks]

Im new to the scratch blocks, so if it dosent show, i really dont know

That won’t make it stop going through walls. Unless the walls are as wide/tall as the sprite.

And that won’t make it follow the mouse.

And I already posted a solution.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#6 2011-06-28 17:30:15

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: Need help making walls.

BuMp>


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

Board footer