Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 1.62 KB

0116-2023-07-16.md

File metadata and controls

27 lines (19 loc) · 1.62 KB

15 Jul 2023

Previous journal: Next journal:
0115-2023-07-14.md 0117-2023-07-18.md

raybox-game

This is a copy of raybox-bridge that I'm modifying a fair bit to turn into game logic.

My first accomplishment has been to load and render the map data as an overlay in Pygame, added an FPS counter, and implemented collision detection.

I've just translated the code in this demo for now, but it's a bit glitchy... when doing a "slide" across a convex corner, it jitters back and forth. It may be needed to prioritise the nearest intersection first, or possibly check all recurrent collisions in a loop. In principle this is simple, but for now I'll check the Wolf3D code and see what that does, possibly linked to ControlMovement.

NOTE: Wolf3D's player "radius" is apparently 0.34375 map units (i.e. 22/64, or the raw value 0x5800 or 22518 in Q16.16). I had to go for 24/64 instead, because otherwise it's possible to get too close to walls and the texture mapping overflows. This could be fixed by either increasing the scaling limit, or not rendering as much screen height (i.e. HUD overlay).

Notes

  • I thought the .hex files I was using (sometimes with @00000000 at the start; i.e. origin address) were some variation of Intel Hex, but it seems they're not at all. They might be specific to Verilog's $readmemh. I'm trying to find out more...