Archived

This topic is now archived and is closed to further replies.

Tszafran

2d Engine Design

Recommended Posts

Hi, I''ve made some 2d engines before, basic ones that served to help me learn DirectX and coding practise. Now I want to create a new engine and take what I have learned from all the smaller projects and create something I will be proud to show around, so I am creating a new 2d engine. I was wondernig if anyone has any tips or good layout suggestions for a engine of this type? I didnt like the way I had it laid out last time, each sprite was sent to the blit function, I was thinking of making a CSceneManager to handle all the sprites and the render function would go through the sprites in the CSceneManager to draw them all. I am open to ideas so please post some layouts or good reading. Thanks.

Share this post


Link to post
Share on other sites
Personally, I think you already know the answer to this question. If not, then you shouldn''t worry about making an engine yet. What do I mean?

I was in the same boat as you. I had made a few games and demos here and there. Only I didn''t decide to make an engine just to make an engine, or just to show it off. I realized that in every game I made, there were some things that I''d do over and over, and there was really no need for me to do them every time I started a new game. So what did I do? I created a basica template. With all of the windows, graphical, and input initialization. Ha, I thought, now game programming will be so easy. I never have to worry about initializing again.

And for the most part I haven''t. But as I''ve programmed more, I''ve realized there are other things every game had that I can create general classes for. And so evolved my engine/template, the Flat Red Ball Template, for the past year+.

So what would I tell you? Just think. Think of all of the things that you have done over and over again. Also, think of how your games differed in the end compared to what you initially wanted the games to be like. Why were they different? Was it something you wanted to do, but it was just to hard to do? If so, think how you can solve this problem.

One basic example of this was I didn''t create very complex enemies in my first shooter, ie. enemies that had a lot of things connected to them that could move, like rotating guns. So I created a member on my sprite class that allows me to "attach" one sprite to another, and the secondary sprite will move according to the first. Let me tell you, that has become so useful, anywhere from adding guns to planes to adding a tongue to a frog.

Over time, your engine will evolve into something more and more useful, and you will find yourself being able to make games faster and better than before.


--Vic--

The future of 2D game development:
Flat Red Ball

Share this post


Link to post
Share on other sites