How would I go about updating my electronic circuit simulator's 'electricity'?

Posted by liqwidice on Game Development See other posts from Game Development or by liqwidice
Published on 2014-06-05T23:22:10Z Indexed on 2014/06/06 3:42 UTC
Read the original article Hit count: 103

Filed under:
|
|
|

I have made an application which allows the user to place down wires, power sources, and inverters on a virtual circuit board. All connections between tiles are automatic, as shown here:

zero conncetions two conncetions three conncetions four conncetions

As you can see in the last image, the updating of power throughout this grid is not yet functioning. I think I understand how to do this updating conceptually, but getting it to work in my program is appearing to be much more difficult than I first imagined. My source code can be found here.

If you have any tips as to how to I might approach this monstrous task, please let me know.

EDIT

The goal here is to simply get a working application. Getting tiles to pass on power to their neighbors is quite easy, but the tricky part is getting wires to "unpower" after the removal of a power source. The size of the grid is just 18x18, so efficiency really isn't a factor, for those wondering.

© Game Development or respective owner

Related posts about java

Related posts about 2d