1
vote
0answers
77 views

How do I avoid circular dependencies with game events in C++? [closed]

My question concerns three objects in my game: EnemyConfig (a derived class of Event - it's an event that concerns throwing enemies at the player and making her deal with them) and Enemy. The ...
3
votes
1answer
191 views

How and when to choose which objects to run collision tests on?

This might be problem with plenty of good solutions, but it's all not very clear to me, so I though I could ask and probably get some good hints. I'm having trouble figuring out how to handle ...
3
votes
2answers
112 views

Circular Method Calls

The title may be a little wrong for what I am asking, but that was the closest I could think of. My problem is I am making a game that includes a World class and a WorldObject class. the World class ...
0
votes
1answer
99 views

watching for changes in object state

I'd like to know what others do to watch for changes in object states while the game is running. Say you have an object and that object has a timer. The timer completes. What is the best way to know ...
3
votes
1answer
165 views

Mesh objects and a draw function

I'm currently working with a mesh class so I can easily create mesh objects. Now I want a draw function in my mesh class so when ever i want draw it to the screen I can just call it without any fuss. ...
0
votes
1answer
752 views

cocos2d-x - object creation and management in game design

How do others keep track of everything going on in their games? I am working on a new game and I am quickly realizing everything that I need to keep track of. Example: Maybe a layerManager that ...
-3
votes
1answer
152 views

How are certain objects named in OpenGL?

I am a beginner in OpenGL, and I would like to know how to distinguish specific objects in an OpenGL game. For instance, the game world contains 3 gems of different colors, how can I know which one ...
4
votes
4answers
5k views

What is the most efficient container to store dynamic game objects in? [closed]

I am making a first person shooter and I know about about a lot of different container types but I would like to find the container that is the most efficient for storing dynamic objects that will be ...
0
votes
1answer
1k views

Interactions between game objects

I'm programming a basic Pacman clone to teach myself game programming. However, I'm struggling with the best way to have the game objects communicate/interact without my code becoming a huge mess. ...
5
votes
3answers
1k views

Object-oriented Snake game design

I'm going to make a snake remake with SDL library and right now I'm thinking heavily about the object-oriented design. I can imagine that I will have classes like GameEngine, Snake, Board and Food, ...
1
vote
4answers
367 views

What is the best method to use to write and handle multiple levels?

I have a level class that does all of the updating and drawing and everything pertaining to the level. My question is, what would be the best approach to creating different levels? Should I just ...
6
votes
4answers
4k views

Object-Oriented OpenGL

I have been using OpenGL for a while and have read a large number of tutorials. Aside from the fact that a lot of them still use the fixed pipeline, they usually throw all the initialisation, state ...
6
votes
2answers
2k views

How can I handle inventory in an object-oriented way?

I'm trying to think of the best way to handle player inventory following an object oriented approach. For example, sword and axe are two different classes, both inheriting from weapon. Weapon and ...
0
votes
1answer
328 views

Problem creating levels using inherited classes/polymorphism

I'm trying to write my level classes by having a base class that each level class inherits from...The base class uses pure virtual functions. My base class is only going to be used as a vector ...
1
vote
2answers
117 views

How do I make a pointer point to the current running level if each level is its own class?

I'm hard-coding my levels and coding each level in its own class...The problem is that I need to have a pointer that points to the class of the current level. I don't know how I would go about doing ...
3
votes
3answers
1k views

Game Object Design

I'm having a problem with the way I designed my first simple game in C++. I have GameObject (abstract class) and ObjectA which inherits the update() and draw() methods from GameObject. My main loop ...