Writing my own 2d game engine

Started by
6 comments, last by drdarkon 21 years, 8 months ago
Hey everyone, For our next game I am going to be writing a 2d game engine using OpenGL. I pretty much understand OpenGL, the part I am having the hard time with is the whole 2d engine thing..heh.. I am having a really hard time deciding how to best manage my objects and their animations, frames, etc... Do any of you have ANY suggestions at all or can you point me to ANY useful resources? Your help is very, very appreciated.. - Jesse Barksdale - Say What? Studios
Thanks
Advertisement
As for resources, Tricks of the Windows GPG has a nice 2D engine using ddraw and if you can, pick it up because the layout is a nicely designed C engine. Unfortunitly, C++ is what you want to use, right?

Well, keep your code very modular. Everything has to handle itself. You don''t want too classes relying on each other''s functionality. Also, don''t be afraid to use structures at times. They''re sometimes better than classes for passing data without worrying about public, private, and protectedness. Other than that, I''m sure you''ll be able to figure out a good design. Oh yea, decide whether you want it to use dlls or source files. Both are good at times. so it''s just a matter of what you want.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org
--> RapidStunna
struct are just like classes ... there is no difference for the compiler.
Please... could someone at least point me to somewhere that might help me?

Thanks
Thanks
The reason I am asking this is because I am doing a 2d fighting game. So I REALLY have a lot of frames and I have to have a good way to manage them all.

Any suggestions or places you can point me?

- Jesse Barksdale
Thanks
If it''s really important to you, invest in a book.

Tricks of the Windows Programming Guru''s
or
Windows Game Programming for Dummies.

it''s like anything else, you only get out what you put in.
Tricks of the Windows Programming Guru''s supplies an excellent 2d engine c\w load(),animate(), move(), draw() etc functions but pay attention it is based on direct x 6.0 not on opengl.
I have used it as starting point to design my own opengl 2d game engine, but of course I had to carry out a lot of modifications.
however this book is really full of useful "tricks" .
For example it explains the use of "patterns" , "animated sequences ", "data structure " ,"sprite management " and so on, once you have grasped the concept you can reuse or rewrite the code yourself.
Unfortunatly there is no 2d opengl book
quote:struct are just like classes ... there is no difference for the compiler.


Yea, and that''s why many people use classes over structures but structures have their uses too and I said don''t be afraid to use them. Saving and Loading class data from a file is more difficult than doing it with a structure. There''s plenty of other uses too that they are better over classes. Roughly, you should use classes for objects with functions and structures for plain data.

---
My Site
Come join us on IRC in #directxdev @ irc.afternet.org

This topic is closed to new replies.

Advertisement