Pixelate:Issue 2/Newbie coders diary

From Allegro Wiki

Jump to: navigation, search

My name is Pontus Backstrom or Dakath on the Allegro board (Even though I don’t post that much) and I have been fiddling around with Allegro and C for about half a year now; I have not really done anything that could be considered a real project. I started out knowing completely nothing about programming, so much of the time was spent learning the basics. But I've come pretty far I think, managed to do some neat things, basic tilemaps, animated characters moving around and a pretty neat A* implementation (I love linked lists!) … I have got to upload that one someday, I’m kinda proud of it.

But recently I've decided its time to begin on the real thing, and I have decided to … *drumroll* … make an RPG! Okay, okay I know what you are all thinking. 90% of the Allegro community are making RPG’s, and about 95% never reach the state of completion. But the difference is that I have you all to help me, eh? So what do you need to know in order to do this? A story of course … and I have got some pretty neat and original ideas, saving that for later though. There’s a good Tilemap system, a good flexible scripting engine, combat system, saving and loading … in other words a whole lot of stuff.

So what should I start with? I’m going for the tilemap system … the one I have been using this far much looks like this:

Typedef struct TileMap {
    Int map[LAYERS][X_TILES][Y_TILES]
} TileMap;

And by now I’m sure you are all gasping in horror and averting your eyes at the sight of such horribly primitive ways (It has smooth scrolling though!). But that’s just not going to do. Instead I have been dissecting some of those neat engines that exist, and it seems people create some sort of dynamic array thingies, like this:

int *data, or tile *data;

As a newbie that just didn’t make much sense to me, but after checking it out further it seemed pretty neat, using malloc to make this ‘custom made array’. So I’ll try to experiment with that. I think the drawing function I already have will do however, it redraws the entire screen, but not the tiles that are outside of view.

So, if any of you have any advice or ideas, keep in touch! I can be reached trough the Allegro board or Dakath@backstroms.nu, I’ll be back next issue and let you all know how it turned out. I’ll even try to have some screenshots to show. ;)

Issue 2: The Danger Issue
Previous:
Site of the month
Present:
Newbie coders diary
Next:
Code optimizations
Personal tools