Jump to content
  • Advertisement
Sign in to follow this  
quantumgamez

What's in a 2d Game Engine? Am I doing this right?

This topic is 4151 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello, I'm trying to make a 2d game engine for java games. And I don't know if I am doing this right, or wrong, what i'm missing, what I don't need, etc.. So I'm just gonna try my best to describe to you what I think a game engine is, and what I have in what I think I have done in my best attempt to creat my first game engine, and I would like all the suggestions, comments, and criticism I can get. OK, first I think a Game Engine is a set of classes that makes making a type of game easier. There will be atleast a level class that is used to make levels, an enemy class to create enemies, and player class to easily make a player, an item class where all items that would be used in the game would be created. A small physics, or hit collision class to keep track with eh, physics? And a good image, and sound class to load images, and sound and play them but only when they're needed. This is what I think is a game engine, ofcourse also have a class that acts as a database, calculator, game tracker whatever you'd like to call it constantly running in the background, or only when you need it to. SO, that is what I think a game engine(2d game engine) would be like, and this is what I have made to see if it's a game engine or not. I have attempted in making a 2d Side Scrolling game engine that features
  • Level - class for easy implementation, and creation of as many levels as you can create
  • Player - class to load all sounds, and images of player, and have control through keyboard input, and interaction of all elements, bosses of all levels.
  • Item - class for making easy objects that can be implemented, created on the spot as many as you wish which then is created as an object in the level class simply through a string of characters (i.e. g = ground have a ground object where g says so on the text map turn it into 2d graphics with images, and sound, motion if needed)
  • Boss - A Boss class for easy implementation, and creation of bosse's in the game through the level class. Create as many as you need. Deals with Images, sound, movement, AI.
  • Data - A class that claculates, and manages the entire game. How many enemies have I killed, what is the time, what level am I at, what level will I be at after this one, what boss's are coming up, enemies, etc...High score, to death, blah blah blah
So please if you can read this and give me whatever feedback you would like. Thanks in advance, c.s. Finch

Share this post


Link to post
Share on other sites
Advertisement
Personally I don't see gamecode as part of an engine. The engine is the underlying mechanic that the gamecode runs on, so the sound and graphics systems, collision routines, input handling, networking, pathfinding, etc, whatever functionality your game needs. I usually write multiple classes for each module, and provide one or a few classes that serve as a public interface to that module, rather than stuffing a large module into one class.

So, my Renderer class contains a list of Images, VisualObjects and other stuff, but the gamecode only needs to worry about knowing the Renderer class. The rest is done inside. Same goes for the other modules: I try to provide a simple interface and handle the rest internally.


Anyway, your gamecode sounds good, but I can't tell if it's good enough or not. After all, you know how you want your game to be, so if it's good enough for that, then it's fine, right? It sounds flexible, easy to tweak, and if that's what you need, then that's ok. You can only test if it's good enough by actually using it. You'll find things you wish you'd done different, and things you're happy about. Well, you can refactor some things now, and save the rest for a next engine. :)

Share this post


Link to post
Share on other sites
IMHO that's exactly what a game engine is supposed to be, it's basically a collabaration of classess and tools that let some make a game by just making the content for the game.

alot of people seem to get mixed up, and think game engine are way to generic, game engine are designed to focus on one type of game. Most people who say they're going to make a 3D game engine are usually just making a 3D renderer.

Share this post


Link to post
Share on other sites
There's no single accepted definition of exactly what an 'engine' consists of, and you'll probably find almost as many subtly (and sometimes not so subtly) different answers out there as you'll find programmers.

In general, an engine is a collection of pre-written code (not neccesarily classes; although that's quite common it's also entirely possible that some or all of the code might not be OO at all) which provides useful functionality which is often (but not always) non-specific to the current project but which will often be specialised for a certain type of project.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!