Circuitron is a simple puzzle created for the “Weekly Game Jam” hosted on itch. The theme is “Electricity”. There are a couple of days left so plenty of time for tinkering!
The aim of the game is to complete an electronic circuit by reorienting red connectors displayed in a grid form. The power source is on the left and a light bulb is over on the right.
As the levels are relatively small, I put them all in a single tilemap and copied the respective tiles to the playing area when that level is reached. This actually simplified things quite a bit so I’ll likely use that idea again in the future for single screen games.
The trickiest part of the code was probably the routine to trace through the connections to determine if a circuit had been completed. I wont detail how that was done in the end but it seems to work well.
Other than that it’s pretty simple stuff. There is a premade solution for each level and the remaining tiles are randomised so it’s likley that alternate solutions will also be possible.
Check out the HTML5 build here - https://www.defold.com/community/projects/129450/