DEV Community

TimWatsonNZ
TimWatsonNZ

Posted on

Unity Dev-blog 4

I'm currently working on wiring up all the menus and creating a proper game loop where if the player dies they can exit to menu or restart.

I always find this a bit tricky, there must be a generic pattern I can use, next game I'm thinking of wiring this up at the start. Although I'm using a game manager which is initiated in the menu to then setup objects like the player. This makes testing individual scenes awkward.

In the process I ran into a few bugs, like the player stopped moving due to some code which restricts its movement. The bounding box was 0 so the player could never move.

Once this is all done I can get back to the fun bits, doing this wiring feels clumsy and tricky.

I also was struggling with object collisions, I don't know if I can use rigidbody.addForce but turn off physical interactions. I don't want players and enemies to actually bounce off each other for instance.

In the next stint I'll try finish off all this menu code and start on code to upgrade the player.

Top comments (0)