Plumber’s Smile – the pipes

Another day another post – that’s because I want to get up to speed to the current state of the game after the gamejam. So next thing I would like to show and write how I approached it is the level design. It would be best to just see the final gamejam result of one level showing the main gameplay mechanic:

The main goal of the player as I already wrote before is to fix the pipes’ layout on the level. You do it by approaching the tile with a pipe that has to be fixed and kick it – this results in rotating the pipe.
The „problem” was how to present the pipe tiles and I decided I will treat pipes as background as they are mostly static. To create backgrounds on C64 I had to use char maps with graphics instead of… well – characters. I decided the pipe tiles will be built from 3×3 characters and in most cases, some characters could be reused.

Here’s charset I made in Turbo Rascal built-in editor, as you can see I’ve also made simple font replacement for titles and scores:

Every character has a resolution of 8×8 pixels in single color mode and 4×8 in multicolor due to C64 specs. All characters have indexes that I used to build my pipe tilesets with:

So all pipe configurations were specified in code using a combination of characters that should be displayed. I also had to specify to what tile another tile is transforming when a player kicks it:

Initial level setup is kept in the array 13×8 containing the tile indexes and when a player kicks the pipe he wants to rotate I’m just changing that index to adjacent one from the table above and redraw new tile on the screen. The level setup in code:

I’ve also managed to add simple collision detection thanks to the not-so-memory-efficient array that describes which character has a collision with simple zeros and ones:

Ufff – this post made a heavy turn into the programming side but I hope it’s somehow informational to anyone reading this and from next post I will try to show more entertaining stuff as I will focus on the post-jam changes to improve graphics and gameplay

Dodaj komentarz

Witryna wykorzystuje Akismet, aby ograniczyć spam. Dowiedz się więcej jak przetwarzane są dane komentarzy.