Tag Info

New answers tagged

2

If you are using a State Machine and are worried about it being modular and extensible, you can follow the Strategy Pattern using Interfaces to define the various states. This answer gives a fairly good idea of how to go about doing that. To make it even more extensible, you can drive the state transitions from a State Transition Table and populate that ...


1

Here's what I normally do with my states. It might not be the best way, or even the second best (but remember, the thing that matters is not the architecture of your game code, but the actual end result.). I start with a basic State-class (all code in Pseudo-C++): class State { virtual void Event(Event e); virtual void Update(float deltaTime); ...


3

Here is my suggestions Dealing with Trees You can do any tree by using tables. It can serve as dependency counter for what ever tree you are doing. Already tested by me some time ago were skill tree, knowledge tree and my favorite, item tree. For this example we are going to use "Item" tree. Each item will be a record for the table name ItemTree. They ...


0

Whether or not a "Weapon", a "Character", or the "World" (or some other more global concept) should contain a collection of bullets fired depends largely on how you want the bullets (or, generally, any object/concept) to be considered in your game. Questions to ask: Weapon: Does the bullet exist as tied directly to the weapon? If the weapon changes or ...


0

I think that any good OOP source you check will advise you to program against interfaces, which is one of the pillars of OOP, so your first option would be better. However the problem here is conceptual. If you think about it, your weapons doesn't have a bullet, as your model suggest, but it produces bullets. In that sense, what your really need is to use a ...



Top 50 recent answers are included