Movement, Controllers, and Putting Code Together

It’s the end of the first week of development. While the art team was working on laying out the concept for story and character design, the programming team worked on a quick prototype of the game mechanics.

I was in charge of getting a movement system setup, along with controller support for the two players. I had some old code from a previous 2D platformer project so I used that as a base. Since this game will have two players, I had to decide how the camera would function. Since the brother is the slower of the two characters, I had the camera follow him exclusively. The sister’s position in the game has no affect on the camera. I added restraints to the sides of the screen so that the sister can’t wander off where the camera won’t see her.

Controller support was some work. The process behind setting it up isn’t too difficult once you know what you’re doing. But before you do understand the process, it’s a bit obtuse. Unity has a list of input settings to toy with, but the setting names don’t always convey what they actually do. For example, I made a setting that mapped jumping to a button on Player 1’s controller. I edited the setting to “Controller 1”, which I thought would keep that button to Player 1’s controls. However in testing, jumping with that setting caused Player 2 to jump too. Turns out setting “Controller 1” only works for certain situations, and otherwise you have to name the button according the the controller you want to use. Once I figured that out it was easy, but it was annoying getting there.

Lastly I took the code from the other coders and added it to what I had. Unfortunately not all of it worked, so I had to cut down or dummy down some of the features we would have liked to have for our prototype. Next week though we’ll be having a meeting on how to better share our code.

Week 1 had a pretty tight schedule and I didn’t get any sleep tonight, but at least the demo’s finished.

See you next week.

-Noah Nam

untitled
Our prototype, with rough placeholder art. The reused character sprite is from King of Fighters, Noah’s favorite fighting game.

Leave a comment