Saturday, August 11, 2012

Intro, Animation, World

This is a web log of my efforts to clone and to extends The Legend of Zelda: A Link to the Past.

My goals for this project are:
-Write it in C++ (to learn)
-Make the gameplay as close to the original...
-Then extend and change it into a different game

So far, I have an extremely basic version going. I have an animation system worked out, as well as basic player movement. The animation speed is much to slow, though, and will have to be sped up. The next thing I am going to work on is getting a tileset and world map up, and then will work on collision.

One of the largest problems I see ahead is how to base the collision with the animation. The player location is stored as an (x,y) coordinate, and the player sprite is blitted downwards and to the right. This makes collision when walking easy,  as I can just make a static bounding box for the collision area. However, once you factor in the swing of the sword, you get possibly two or more bounding boxes in different directions. The bounding box for the sword depends on the direction that the player is facing. I could just hard-code the sword swing in, but I think creating a more dynamic solution would make coding enemy attacks in easier. I may make a weapon class that contains collision and bounding box data, then have a pointer in the entity that holds it. This won't be completely dynamic, as it would be compiled and not a file, but it will work well enough.

The world map will be easy (I hope). I can simply store a 2-D integer array for the tile types, then have a tileset map to the sprite as well as any other data. This will make loading and changing easy. I might want to add in a command system to the game so I can load different maps and execute different code without having to recompile.

No comments:

Post a Comment