Friday, 23 November 2012

All of the angles

It's really hard to show progress from coding projects - simply because hours of work might just result in a different position a colour change or something you can't see, But here is what I have achieved this week with my project;

Spawning: I can spawn hubs (centre circular thing) in any position on the screen. I can also have different combinations for different levels.

By changing the type of the hub, I can also spawn any number of inputs and outputs (sticky-out bits on the left and right sides) which are then automatically spread evenly around the sides.

I also have a level system, in which I can specify the level number, or the game state (main menu, level select, main game, whatever else).

I came up with quite a few problems with using unity to do these things; one of the main things was how arrays work; it required me to have a major read-up on the types (more than one) of arrays and their uses HERE (and in my books). I actually ended up using a Vector4 as a mini-array for storing integer information, it ended up being more compact and easy than proper 2D arrays (array inside an array).

Here are some functions which I made (No use posting tonnes of code, but these are the critical parts

The function which specifies level contents.

Function which creates the type of function box based on pre sets and the input that is given (must remember to have a "0" colour which means "doesn't matter").
Function which rotates the inputs and outputs based on how many of each there are.

I think I'll skip the inventory for now and concentrate on getting connections between function boxes available (and start and end points of course).

1 comment:

  1. Good. When you blog it would be really handy if you just use a line or two to refer back to your project timeline so we know where this is in relation to it. Your timeline says 'possibly spawning hubs' but i dont know if the other stuff on the timeline are now complete.

    rob

    ReplyDelete