Epsilon

One Game a Month - January

Posted on March 23, 2014

It seems like all my work with regards to the one game a month challenge gets delayed. In this post, I will be discussing the platformer I worked on in the first month of the challenge. Since this is one game that I did not end up finishing, I will be merely posting my remarks in making it. If you aren’t familiar with this challenge, please look at my previous post

Player walking through level

Player walking through level

Various Developer Troubles

One of the things I enjoy about making games is that they are a great teaching tool about programming in general. As I go through making a game I find out the areas in which I am lacking as a developer and attempt to alleviate them a little. This game in particular made me realize a few areas I needed more work on.

One of my weaknesses as a developer is that I tend to jump into the code and work my way through the various features I am expected to have done. On small well defined projects this is not really a problem, but with big projects (like game making!) this problem rears its ugly head. What ended up happening for this project is that I had to refactor my code a few times before it got to a state where I could continue.

The other problem I ran into was a different form of inexperience. When I was writing my code I had a great amount of difficulty seperating out the different things I wanted the platformer to have. In particular, the player’s state was difficult for me to express. The things I wanted the player to do was fairly simple, just move and jump. When I got to writing it though there were a ton of edge cases I had to check. What if I tried jumping while in the air? How did movement work when the player is falling? What ended up happening is that I expressed this in a single monolithic player class. Later, I learned of the state machine pattern and my eyes were opened. That pattern gives a nice concise way of seperating these concerns out. This was yet another refactor to add to my code.

Player jumping into the air

Player jumping into the air

Physics Fun

The other interesting bit was working with the physics engine. The physics engine made movement pretty easy, but somethings were a little interesting to figure out. When it came to movement I had a difficult time expressing the movement how I wanted it in terms of physical properties. I tried doing various forms of friction and acceleration/forces, but in the end I made it easier on myself and just set the friction fairly high and when the player was moved to set them to a constant velocity. I had the same difficulties with jumping, but that was easy to figure out once I found a way to do the normal movement.

Conclusion

While those were my more concrete problems, I think the problem in general was that I chose a project that was too big a scope for me to do. Before my next projects I’ll be trying to keep the scope much lower.

comments powered by Disqus