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

#1 2012-08-28 10:10:46

YoshiRulz1
New Scratcher
Registered: 2012-08-28
Posts: 2

How to make solid walls

i cant figure out how to make a solid wall! i need to be able to do it with only one sprite. can someone help me?!!?!?!?!

Offline

 

#2 2012-08-28 12:41:03

powerpoint56
Scratcher
Registered: 2012-04-19
Posts: 500+

Re: How to make solid walls

You mean have a single sprite for the wall and the thing you move around? Or do you mean there's a wall sprite and an object moving around?

Last edited by powerpoint56 (2012-08-28 12:41:23)


http://i48.tinypic.com/2072ctw.gif

Offline

 

#3 2012-08-28 17:30:01

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: How to make solid walls

In addition to what powerpoint56 said, do you want a script for a platformer or for a top-down kind of thing?


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2012-08-28 21:32:40

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: How to make solid walls

The script will take the form of something like:

if < [x/y position] > [constraint] >
set [x/y position] to [constraint]
Note: Scratchblocks errors are intentional.  I'm just showing that you constrain an x or y to be greater than or less than some value based on the level setup.

Last edited by amcerbu (2012-08-28 21:33:23)

Offline

 

#5 2012-08-30 11:17:35

YoshiRulz1
New Scratcher
Registered: 2012-08-28
Posts: 2

Re: How to make solid walls

its for an old style rpg kind of game (like the first zelda) i need to make it so i cant go through objects

Offline

 

#6 2012-08-30 12:12:46

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: How to make solid walls

Try making all the objects you can't pass through the same colour (or at least have the same outline colour - something which will blend into the background but isn't the same colour as any of the background)

Then do

when key [up arrow v] pressed
change y by (10) //or whatever speed you want to move at
if <touching color [#000000]?> //whatever colour you are using for outlines - see above
  change y by (-10)
end

when key [down arrow v] pressed
change y by (-10) 
if <touching color [#000000]?> 
  change y by (10)
end

when key [left arrow v] pressed
change x by (-10) 
if <touching color [#000000]?> 
  change x by (10)
end

when key [right arrow v] pressed
change x by (10) 
if <touching color [#000000]?> 
  change y by (-10)
end

Last edited by joefarebrother (2012-08-30 12:13:21)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

#7 2012-08-31 17:37:10

sparky5000
Scratcher
Registered: 2011-01-31
Posts: 7

Re: How to make solid walls

i made a project and made the wall broadcast a message when it was touching the sprite then the sprite would stop the controls and move back severall steps antill it stopped reciving the message. then the controls would start again.

here the project if you want a look?
http://scratch.mit.edu/projects/sparky5000/2755659

Offline

 

#8 2013-01-01 06:23:19

jamminjoshc
Scratcher
Registered: 2011-06-21
Posts: 9

Re: How to make solid walls

joefarebrother wrote:

Try making all the objects you can't pass through the same colour (or at least have the same outline colour - something which will blend into the background but isn't the same colour as any of the background)

Then do

when key [up arrow v] pressed
change y by (10) //or whatever speed you want to move at
if <touching color [#000000]?> //whatever colour you are using for outlines - see above
  change y by (-10)
end

when key [down arrow v] pressed
change y by (-10) 
if <touching color [#000000]?> 
  change y by (10)
end

when key [left arrow v] pressed
change x by (-10) 
if <touching color [#000000]?> 
  change x by (10)
end

when key [right arrow v] pressed
change x by (10) 
if <touching color [#000000]?> 
  change y by (-10)
end

SO HELPFUL FINALLY. Before i found your comment all my games had that problem but now im making a pac man

Offline

 

#9 2013-01-01 08:45:48

Tbtemplex97
Scratcher
Registered: 2011-11-12
Posts: 100+

Re: How to make solid walls

maybe use a script like:

when right arrow pressed
   if not touching colour [black]
      move 10 steps
else
   move 1 steps


Online Status: http://blocks.scratchr.org/API.php?action=onlineStatus&amp;user=Tbtemplex97
Darkspace Coming Soon!, Try the Singleplayer Demo

Offline

 

#10 2013-01-01 11:43:23

Nomolos
Scratcher
Registered: 2011-07-29
Posts: 1000+

Re: How to make solid walls

joefarebrother wrote:

Try making all the objects you can't pass through the same colour (or at least have the same outline colour - something which will blend into the background but isn't the same colour as any of the background)

Then do

when key [right arrow v] pressed
change x by (10) 
if <touching color [#000000]?> 
  change x by (-10)
end

Fixed.

Last edited by Nomolos (2013-01-01 11:43:46)


Goodbye 1.4. I'll always remember you and treasure your awesomeness in my heart.
RIP 1.4: 2007-2013 *Sniffles* *Sobs* *Bursts into tears*

Offline

 

Board footer