I'm looking to make it so when you hit certain blocks it changes your direction. How could I go about doing this?
You mean your character on the screen? A car? You will need to be a bit more specific i'm afraid.
If it is a character, do you use 8-directions control or platformer? Or is it just an object that is animated to automatically move by setting coordinate increments?
Develop games in your browser. Powerful, performant & highly capable.
It's a runner my character goes right, but if I land on a certain block I want it to change my direction to make him go left. So if he lands on the first 2 blocks after he lands a jump it causes him to move left and fall off the ledge and die.
The idea is that you create a Global Variable and basicly let the movement switch when the variable changes. And when you touch the block it switches the variable..
Figured i would make an example..
That's perfect! Only a small thing though, the block when you collide into them lets your character go half way into them.
I noticed that too. I thought it had to do with the image point or origin of the image but when i tried that it didn't help. Perhaps try 'overlap at an offset' instead of 'on collision'? I don't know really.