I'm making a top-down scrolling game with velocity. How would I make the main sprite bounce off of a color in the background? Meaning, what would the "bounce" be in:
when gf clicked forever if <touching color [ ]?> bounce end endThanks!
Offline
If it's touching the color that defines walls that run left-to-right (walls that block vertical movement) multiply y velocity by -1 (or by some number a little closer to 0, like -0.5, if you want some velocity to go away). If it's touching the color that defines walls that run up-to-down (walls that block horizontal movement) multiply the x velocity by the same number (either -1 or something like that).
Offline