Linux Format

Code a classic Star Wars scroller

OUR EXPERT

Ferenc Deák never throws anything away, which is why he still has all his demoscene files.

Last month, we had a short introduction to SDL2, and created a more-or-less usable L coding framework on which we can base our implementation of some of the most notorious effects of the ’90s demoscene. This month, we are continuing the recreation of those effects, and introducing some auxiliary mobility into the not-so-dormant screen we created last time.

The fire effect was one of those quick-and-dirty effects of the ’90s that seized the attention of spectators at a demo party and ensured instant recognition from your peers. Implementing it involves creating a visual simulation of flames on a computer screen. This is typically achieved by representing the fire as a grid of cells, where each cell corresponds to a pixel and holds a value representing the intensity or temperature of the fire at that location. The process begins by initialising the grid, setting up the initial state of the fire, then iteratively updating the values of each cell based on the value of its neighbours. Randomness is often introduced to add a natural and organic appearance, and the intensity values are mapped to a colour palette set up to recreate the colour scheme of those found in real flames. The simulation is animated by continuously updating and rendering the grid.

The fire palette

Due to the nature of the effect, the palette

You’re reading a preview, subscribe to read more.

More from Linux Format

Linux Format9 min read
Create Old-school Pixel Art Images
Credit: www.gimp.org Think of retro games and you’ll probably think of the pixellated look of titles released on consoles such as the NES. Games such as Bomberman and Kid Icarus worked within the limitations of ’80s technology, yet offered hours of f
Linux Format5 min read
Vintage PC options
Having got LMDE installed on our woefully underpowered EeePC, it became apparent that the machine wasn’t going to be very useful. Except for pandering to our sense of nostalgia. According to Systemd-analyze, it took a minute to boot (as far as the lo
Linux Format1 min read
Tom’s HARDWARE
No matter if you're building a PC, buying a laptop or learning about robots, Tom’s Hardware has all the comprehensive knowledge you need. Scan & Subscribe for free! ■

Related