I'm creating an RPG, with an over-head view, but I can't seem to be able to make a good collision code for walls. Could anyone help me out? I'm having trouble making walls collidable. Hopefully a simple code, would be nice, one working simply off of the character touching a certain color?
Offline
I think I know what you're asking. Are you asking how to make it so I sprite can't do through walls? If so, here is a script for blue walls.
When right arrow pressed
change x by (10)
if <touching color blue>
change x by (-10)
Make the script for every directions. You may also use the <right arrow pressed?> block and/or the [move ( ) steps] block.
Does that help?
Offline
scmb1 wrote:
I think I know what you're asking. Are you asking how to make it so I sprite can't do through walls? If so, here is a script for blue walls.
When right arrow pressed
change x by (10)
if <touching color blue>
change x by (-10)
Make the script for every directions. You may also use the <right arrow pressed?> block and/or the [move ( ) steps] block.
Does that help?
DO NOT USE THAT unless the sprite is a 1x1 pixel.
If you do that and your sprite is bigger, then your sprite could get caught on a side thing and everything will go creepy.
Offline
Eafu what was the script? The examples I saw weren't very effective, and prone to glitches...
Offline