Jump to content

  • Log In with Google      Sign In   
  • Create Account


Member Since 01 Apr 2013
Offline Last Active Nov 15 2014 11:05 AM

Topics I've Started

Always running into a circular dependency

29 November 2013 - 07:33 AM

Hi guys.


So whenever I try to make a game I run into a problem where a circular dependency occurs between the scene or level holding my game objects and the game objects that need access to the level. I am sure this can be easily solved because my architecture is structured wrong but I just can't seem to think of an efficient solution. I'll roughly show what I have (just the parts that are causing the dependency).



#include "ObjectList.h"
class Scene : public EventListener
ObjectList objectList; // This holds all the entities that are currently active in a particular scene/level.


#include "Entity"
class ObjectList
std::vector<Entity*> objectList;


#include "Scene.h"
class Entity : public sf::Sprite, public EventListener
Scene *gameWorld;

Lost my stylus

09 November 2013 - 08:32 AM

Hey guys.


Firstly let me start off by saying that I am by no means an artist, I just like drawing every now and then. I have this really old tablet that my father gave me that he found at work or something but I've managed to lose the stylus.


The type is a genius G-Pen M712X, the only way I can see to get the stylus is ordering from the genius shop online. The problem  is they don't ship to South Africa. I've searched Ebay/Amazon and nearly all those sites but I can't find a way to get the stylus.


So my question would be, will another stylus work? I know the pen has 1024 different pressure levels so would another stylus with the same specs work? Sorry if this question sounds completely stupid but I have no idea how tablets work :/

What does unit testing mean?

12 July 2013 - 04:02 PM

Hey guys.


So a lot of the blogs/tutorials that I have been reading refer to unit testing a lot. It will say that a certain approach makes it easier for unit testing etc.. I did take a glance at the Wikipedia page but it's too much new information for me to solidly grasp. I'm still in high school so I have yet to learn the jargon/glossary associated with a Computer Science course.


So I was wondering if one of you could explain it to me in simpler terms and perhaps a basic implementation of how it is used and why you would use it. 


Thank you.

Managing objects in different game states

08 July 2013 - 02:58 PM

Hey guys.


So I was wondering how should entities or objects be handled in different states of the game. I have an obvious Object_Manager class but

it is not a god class. It only contains a list of all the objects that are needed in the current situation and an interface for adding, updating and removing objects. 


But so far, because I only worked on very small projects (I won't even call them games) I never worried about main menus or more than one 

level to be honest. Now that I have different states I have no idea what the best practice is regarding the handling of these entities. 


There are two solutions that I can think of. The one is to have only one instance of Object_Manager and then just remove and add entities as the states switch. OR Each state has a instance of Object_Manager and then the state itself worries about the cleanup. 


I have no idea if I am even heading in the right direction here so any help would be appreciated. Also just a little off-topic question here:

Should entities that are "dead" be removed from the list in Object_Manager or should entities have a variable containing an "alive" variable and the updating just gets skipped if the object is not alive.


Thank you.



PS: Just to clarify my "states" are classes on their own. So it's MainMenu, Intro, Level etc...

Where does game play come in?

05 April 2013 - 08:10 PM

So over the past couple days I have learned a lot about design patterns and game architecture but now another mountain has appeared.

Using a lot of resources(books, articles) I have created a project that implements objects that have components (completely de-coupled) from each other, a rendering manager that draws all my objects and physics system that detects collisions etc.. Now this is good and all but I am missing the most important piece of this puzzle: where should game play specifics be implemented then? I mean for it to be a game somewhere there must be rules that define the game. 


Where in this whole process will I code:  If the player is near the tree, the squirrel must fall out. 


Is there some crucial part I am missing? It seems completely illogical for me to have these behaviors defined inside the classes because that would couple all of my entities and make it impossible to re-use them. Or am I misunderstanding the re-usability thing. Should it be that the classes themselves such as Player and Squirrel  know about each other and can then be thrown away in terms of future use (then only the systems and components are re-used). 


Please don't tell me to just try and "finish" the game. This is not an attempt to finish a game. I am trying to understand how the core of a game is supposed to work and how all of these different patterns and systems work together to produce a finished product. I really hope this post makes sense.


Thank you.