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
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)
Offline
In addition to what powerpoint56 said, do you want a script for a platformer or for a top-down kind of thing?
Offline
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
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
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)
Offline
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
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 dowhen 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
maybe use a script like:
when right arrow pressed
if not touching colour [black]
move 10 steps
else
move 1 steps
Offline
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 dowhen 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)
Offline