Thursday, 3 January 2013

Simple Fixes


The extra scrolling wasn't so bad when just getting down to it, although i might need chris' help in order to get the background tiling evenly on each level (for some reason it doesn't seem to do it any more, but I can't remember what I changed or had before in order for it to work. I also got the colour display working, and after a few tweaks I got power transfer working too.

Start hub - it knows it is a start hub because it doesn't have any inputs, so it automatically sets it to "powered"
Generic hub, un-powered - this means you can connect the outputs to things, but it won't power them until all of the inputs are powered.
same function hub after a powered plug has been attached to it, all outputs are powered because all the inputs (only one on this) were powered.
I had quite a few problems with removing power after the plugs were moved around. for instance  you used to be able to connect a plug to power something, remove it. and the hub you removed it from would still be powered, I had to change the script on the plug removal a bit to fix this.
 the really nice thing with this now is that you can make a chain of powered hubs, but if you remove the power on the first it causes a chain effect down the line, and they all become un-powered.

My next step i think will be adding distance limits to how far you can drag the plugs - at the moment you can connect plugs over any distance, which A. gets messy and B. doesn't have much of a puzzle element to it.

unfortunately I'm a bit rusty on distance calculations (I've been using box2D to do such things in other projects for so long) I'll have to have another read-up on it.

I'll also have to design a range indicator too... That will be interesting.

2 comments:

  1. Take a look at Vector2.distance for your distance calculations requirements.

    ReplyDelete