I've been collecting a few of the more interesting ways I've broken my snake program so far:
- I forgot to replace the arithmetic operators on my Vector types (now an alias of a Long), causing an overflow error and making the snake sever its head. (1/3)
- I wrote some code to keep track of chunk updates and reuse old data to avoid light-tracing on each frame, and used the wrong position value to index them with. (2/3)
This caused *no updates* to occur, drawing light maps on top of each other and creating this horrible mess:
So it turns out programming is kinda hard! (lol)
In good news, though, all these mistakes have actually paid off, and my snake game can now run at about 30fps (that's twice what I had before!) - as long as I avoid any big light sources.