Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits) (+2)

Player movement, jumping and collision are now implemented!


To make the game easier to program I'm using 32bit numbers for the positions, with fixed point math breaking that up into 2 parts. 

The first 16 bits are the whole number: the actual position on screen, and the second 16 bits are used as a fractional value. The pseudo-floating point number allows for smoother, "sub-pixel" movement, like gravity pulling on the player when they jump. 16 bits is overkill for the floating point, but I wanted to have 16 bits for the whole part of the position so that I can fully represent the player's position in world space. This makes all other calculations much easier to understand, because I do all calculations in world space, and only rendering cares about nametables, and screen position offsets.


This features the obvious things like animation, jumping and collision, but there are some more subtle things going on as well like "coyote time" (allowing you to jump for a few frames after falling off a platform) and "jump buffering" (allowing you to press the jump button a few frames before landing, and still jumping).

The code for this is more or less a port of what was going to be my 3rd project (and may still be) after finishing Witch n' Wiz. I just haven't had a chance to get back to it yet. Here is what it looks like. Blades of the Lotus is actually already well beyond what that project was doing!