Slightly odd physics, not entirely accurate. The world is tile based, while entities are pixel-coord based (which is odd). Anyways, you have a little blue rectangle (entity class) on a white rectangle (several instances of the tile class), both stored in an instance of the world class. Odds are, it's buggy. If you find any, please, let me know.
Any tips on how to make this better are welcome; this is the first time I've actually done something with physics.
Controls:
L/R Arrow keys: Move.
Up arrow key: Jump.
Spacebar: Respawn your guy.
EDIT: Known bugs:
Can get stuck if you move off cliff then move in other direction immediately. Not sure how to fix without recoding physics (again).
Seems to "hug" wall when falling and moving towards it. Intentional.
Tile-Based Physics
Tile-Based Physics
- Attachments
-
- TilePhysics.love
- V0.1
- (8.16 KiB) Downloaded 258 times
"your actions cause me to infer your ego is the size of three houses" -finley
- BulbaMander
- Citizen
- Posts: 65
- Joined: Sat Dec 15, 2012 7:00 pm
Re: Tile-Based Physics
You can tap the jump button really fast and your man will fly up. Set a bool in your code, and only apply upward force to the player when the bool is true. When you press the jump button, it's set to false, and won't be true again until the player collides with a tile. That will make me unable to press the jump button a bunch of times in mid air.
It takes an idiot to do cool things. Thats why they're cool.
Re: Tile-Based Physics
or make it an number and allow double jumps and/or boost gauge.BulbaMander wrote:You can tap the jump button really fast and your man will fly up. Set a bool in your code, and only apply upward force to the player when the bool is true. When you press the jump button, it's set to false, and won't be true again until the player collides with a tile. That will make me unable to press the jump button a bunch of times in mid air.
Who is online
Users browsing this forum: No registered users and 218 guests