I think that will work tdarb, i'll go try it out. I'll make sure to credit your counter, it's very handy.
Printable View
I think that will work tdarb, i'll go try it out. I'll make sure to credit your counter, it's very handy.
OK, so your goal is just to have a display of the number of toggles activated, right? Not necessarily to have the total number of "on" switches be the value of one of LBP2's built-in "counter" objects?
Probably the easiest way to count the toggles is to combine them to create an analog signal. Set up a battery at 1%, and wire each input switch to an AND gate with that battery on the other terminal. Then get a battery at 100% and hook it to the positive side of a direction combiner, and hook the output of one of those AND gates to the negative side. The output of the direction combiner will be an analog signal that's either 100 or 99 depending on whether the switch was active. Keep doing this, chaining the output of a direction combiner to the positive input of another direction combiner, and the output of one of the AND gates to the negative side. Ultimately you'll get an analog signal that's (100% - (number of switches active)%) - pass that through a NOT gate and the analog signal will just be (number of switches active)%. Then feed that into a logic meter (build your own or find one online) and you'll have a display of the number of active switches.
Alternately you could build a big binary adder: take the switches in groups of two and turn the inputs into two-bit counts (A AND B -> value 2, A XOR B -> value 1, else value 0) - then take pairs of values, add them together with a binary adder until you've reduced the whole thing to a single binary sum. (Then you'll need to display the binary sum - you could do that by turning it into an analog value and displaying it with a logic probe, or you could create a binary-to-decimal decoder and do it that way...)
Wow, I can't say this is how I was expecting to play this game.
Works perfectly, thanks tdarb and everyone else.
Here is the final product for anyone following along: http://lbp.me/v/xmqpfj .
I added it to my queue. I made a somewhat more primitive Lights Out game in LBP1, so i can't wait to see it!!
Mine is still uploaded too I think, if you would like to have a look :)
This, IMHO, is absolutely brilliant. It doesn't even care if more than one toggle switch is modified during the same clock tick.
BTW, it's not too tough to put this analog signal through an ADC microchip to convert it to a pulse stream. This could feed the counter he is already using.
Queued!
I had another suggestion but I guess you don't need it now..... :(