8 Commits

Author SHA1 Message Date
6bd85d9ebf Rename entity_t and obj_t to dynentity_t and objentity_t 2025-01-04 04:51:27 +00:00
77725a5ce4 Round coordinates in collision detection
This fixes an issue where the player could get stuck to an edge when
being aligned to the pixel grid due to the rounded coordinate being
outside an invalid tile but the truncated position being inside.  Also
we should be doing it anyway.
2025-01-04 02:13:40 +00:00
a8e2c8d89a Rename game_evthandle() to game_evt() 2025-01-02 18:52:15 +00:00
8dbdea6ac4 Fix some memory leaks 2025-01-02 17:53:40 +00:00
2c8d01df49 Fix UB in tileat() 2025-01-02 17:16:05 +00:00
65a4b08f34 Use vsync instead of delay-based synchronization
Also changed the game_update() interface to take dt in seconds as a
double (rather than milliseconds as an unsigned integer) as we're now
computing the refresh interval as a double anyway (by querying the
display mode).  To my eye (and on my machine), all chunkiness is now
gone; the game feels very smooth.
2025-01-02 16:54:01 +00:00
e7e1b40dd9 Take ceiling of endx and endy in mapdraw()
This fixes an issue where tiles around the right and bottom edges
would not be drawn when vpos was just under a tile boundary.  I'm
guessing it wasn't noticable before fixing the frame rate as the buggy
frames were only on-screen for a hilariously short amount of time.
2025-01-02 15:43:31 +00:00
d9981d8d61 Rename app/ directory to game/ 2025-01-02 14:21:12 +00:00