Taking on a Zelda Clone, Part 10

Didn’t get a whole lot of visible stuff done this time around – in fact I pretty much broke the game into a million pieces so it’s not really in a playable state right now.

I felt it was finally time to start taking organization more seriously, so I started working on a generic GameEntity class that most of the rest of the objects in the game can inherit from. It started off very well, but before I knew it ye olde programming monster showed up and soon I was trying to generic-ify the most complex of tasks for no good reason. I knew it’d happen, but it was hard to avoid. Luckily I got back on track though.

Reorganizing code like this is kind of like playing Tetris – you start off nice and organized, but slowly little things pile up that mess up with your smooth plan, and eventually you have to focus on getting rid of those little things before you can get back to smooth running again. That’s basically what’s going on here.

Tile collision detection
Before, I had working tile collision detection, but it was very primitive and definitely overkill. It also had some issues when you wound up going more than one pixel at a time, like if you got hit or something. Then there was the issue of not being able to walk around obstacles very well.

So I decided it’s time to get this most basic of things out of the way by redoing the tile collision system. It’s such a simple concept but it’s always a big pain for me, no matter how hard I prepare for it. This time it took me a couple hours, but I got a better system than before working. Now I’m working on making it work properly if you’re faster than one pixel at a time. I’m not sure the best way to do this, I’m thinking some sort of iterative thing is probably what I’ll go for, but then the idea of recursive function stuff popped into my head.

At any rate, this advanced tile collision is a pain, I don’t know how I’m going to handle it when I try to do something like EarthBound’s collision detection in a future game 😯

This latest version isn’t really playable, but I’m putting it here for archival purposes and for anyone who’s curious anyway. Right now it’s set to moving at 3 pixels at a time.

Both comments and pings are currently closed.

4 Responses to “Taking on a Zelda Clone, Part 10”

  1. Carl says:

    Thanks again for keeping us updated on your progess. I’m curious–are you using any kind of source control to keep track of your files, updates, and changes?

    • Mato says:

      Sadly I’ve never really learned how to do automated source control – I’ve tried in the past many years ago but it was always a crazy learning curve. Do you have any suggestions? Maybe things have improved in the past few years?

      • tapi says:

        http://hginit.com/ this is a pretty easy intro to mercurial

      • Carl says:

        We use both Subversion (http://subversion.tigris.org/) and Git (http://git-scm.com/) at work. I’m personally much more comfortable with Subversion, but all of my co-workers who’ve worked extensively with both swear by Git.

        For Subversion, there was definitely a barrier to entry that was frustrating at first, but after working with it for a bit, everything suddenly “clicked.” I love it now. It makes it easy to collaborate with others, but I can’t imagine doing even a one-man, personal project without it, because of how useful it is in tracking changes, rolling things back, and segregating different features/changes into separate units.

Subscribe to RSS Feed Follow me on Twitter!