Circuit Puzzle Not Working


The Issue:

I was working on the circuit puzzle where the player is supposed to connect the wires together to lead power to the goal node. However I was having an issue with this where none of the wires would be powered and light up green. This was strange because the power source node was saying that it was unpowered which it should always be powered.

The image below shows the source node and the wire not receiving power.

The Solution:

The solution was pretty simple. Every frame the game will check to see if the wire is powered or not. Every single wire is stored within an array which is checked every frame to change the color of the wire. As I was looking for the issue, I found that the array of wires was empty so it was not checking the power on each wire. I then added the wires to the array and it started working.

The image below shows the source and wire now turning green which means it is properly powered.


Leave a comment

Log in with itch.io to leave a comment.