I am making a 2D casual shooter, but I have a problem.
I drew a sprite that is the map of a lvl (the walls)
But how can I make that the sprite that you move, if he touches the wallsprite, he bounces, and that the sprite that moves can't walk true the wallsprite?
Thanks for your help
Offline
Make a sprite with a different colour on each side and put this as its script. Also make four variables called left, right, up and down
? is the colour of the right side of the sprite
! is the wall colour
when gf clicked forever if <colour (?) touching colour (!) set [right v] to <yes> else set [right v] to <no> end endDo the same for left, up and down but with the different colours. Then put this as your moving script on the player
when gf clicked forever if <<key [right arrow v] pressed and (right) = [no]> change x by [10] end endAgain do the same with left, right and up. I hope this helps!
Offline
mrn0body wrote:
Make a sprite with a different colour on each side and put this as its script. Also make four variables called left, right, up and down
? is the colour of the right side of the sprite
! is the wall colourwhen gf clicked forever if <colour (?) touching colour (!) set [right v] to <yes> else set [right v] to <no> end endDo the same for left, up and down but with the different colours. Then put this as your moving script on the playerwhen gf clicked forever if <<key [right arrow v] pressed and (right) = [no]> change x by [10] end endAgain do the same with left, right and up. I hope this helps!
I fixed it already, but thanks for the help.
Offline