Hey guys!
Thank you for the support on my previous post. I was taking a trip down memory lane and I saw this really cool game on CoolMath (eww, I know, but hear me out) on Android, and I wanted to remake it. It was pretty simple. Touch and hold to make the cow change gravity. Would any of you know how to accomplish this? I know that there’s a setting for press and hold.
It seems really simple to remake.
What I would try is to increase the position of the cow on the Y axis until hit a tile if/when the mouse button is down or touch is held and decrease it position on the Y axis until hit a tile if no mouse button is down and no touch is held.
When the position of the cow on the Y axis is less than 50% of the screen, change it animation head up, if it position on the Y axis is greater than 50% of the screen then change it animation to head down or maybe change it animation only if it hit a tile on the top so it looks like it standing on the tile upside-down and if your release the touch or mouse button than change animation back to normal and decrease it Y position…
In case of an endless runner this is all I would do, in case you want to make a platformer game with this feature, I’m not so sure if the platformer behaviour can be manipulated to make this because of the direction of the gravity and jump, you might need to making your own platformer engine which is totally possible but not that simple.
I was not able to do it in with the Platformer behavior, you can invert the gravity but the jump speed can’t be negative and you keep accelerating up even if you collide with an object…
You could try with the Physics engine, I have an example here (press Space to invert the gravity): InvertGravity.zip (6.89 KB)
The problem with the Physics engine is that you have to write all the conditions to be able to walk, jump, etc. manually, while the platformer behavior has everything out of the box.