Skip to main content

On Sale: GamesAssetsToolsTabletopComics
Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Devlog 4

Didn’t have much time for programming today, but managed something spicy in my opinion. I’ve used glitch like effects in multiple of my games as I’m quite fond of it, but all of those were applied to the whole screen.

In this game the Hologram Module update will grant you evasion chance, and i wanted to signal it with something along the line of a disturbed local hologram picture.

This of course requires some math, as you will need to convert your (x,y) screen position into the corresponding memory adresess. TIC-80 has it VRAM layout so the screen starts at th adress of 0x0000 resulting in 240x136 = 32,640 4-bit pixels. To convert into this, we take our x coordinate and add y*240 to it, to determine the index of the pixel we want. This then needs to be converted into a hexadecimal number, and now we have a memory addres we can poke().

After this the algorithm is fairly simple, generate a random start and end point on each y level of the sprite, and poke4 the memory adresses of those points with color 11. All this with 50% chance, for five frames after getting hit, and just replace the player ship draw call so we have this truly flashing effect!