I found some time to get some of the scrolling done in my game - It took a little less time than I expected actually, but overall after researching about "Delta time" (A Way of making game frame-rate independent ) it took about roughly the same amount I expected. I may not the deltatime function much in my current project, but it is A very useful steppingstone for other projects/unexpected areas.
Anyway, I added some script which allows the camera to scroll left and right when the mouse is near the edge of the screen (only if there is level content to see there though). I have an additional up and down scrolling version which is //*commented out*// just in case my game or level design needs extra height in the future (it will need some work, but it's nice to plan ahead).
While creating the scrolling, I found I needed to do another task which was add and resize the background based on the level length. I had already made some background creation code for a basic background so I just had to spend some time neatening it up, and changing it slightly so I could plug in length values. If I do decide to add additional vertical scrolling I will have to change the background code slightly, but the main thing is that I know this is possible, even if it will take a little longer than the additional up and down scrolling by itself.
I also Added a lamp to the camera. It was a spur of the moment thing, but it's quite an amazing effect as scrolling now changes the lighting and shadows of the scene. I may change this to a spotlight depending on how much range/brightness of the lighting I need.
Because I finished these tasks (and I was trying to be productive while I had the motivation), I started work on the "Activation of hubs" task. It is nowhere near finished, but basically what I did was add a check to the hubs. "If all of the inputs are active, set all of the outputs to active, otherwise, set all of the outputs to inactive". It's a simple rule, using variables that are not yet affected by anything, but it should stand strong through development.
I would show this scrolling and background but Unfortunately I don't know how to embed or link to my unity game on here (and pictures would show nothing more than last week). (if anyone knows how to do that, let me know).
My next task will most likely be the addition of plugs, and the dragging of them. I'm not entirely sure of the best way to do this (as most of my time is figuring out the best way to do something, rather than coding it) so I may ask for Chris' input at some point if I don't get a good idea.
While thinking up how to do the above, I thought about how you may eventually be able to connect a hub to itself (because I think insanely far ahead). May cause a major problem but It will give me another problem to think about overcoming eventually.
No comments:
Post a Comment