So I'm trying to maintain a better coding style, and for the next game I plan to make, I want to make an 'EntitySystem'.
Now in my mind, I think of an Entity as anything that moves, so I was thinking of having the EntitySystem composed of 3 other systems:
*PlayableCharacterSystem
*NPCSystem
*(Placeholder) System - Not exactly sure what to call everything else that moves (such as bullets).
But my question is, is this a good set up? Should things such as bullets be grouped with Characters/NPCs?
(As an added note, I'm not making something huge like an RPG, just a SHMUP, but I want to be able to have a lot of reusable code in the end)
Thanks in advance for any input.
Entity System
Moderator: Coders of Rage
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Entity System
Heres my input, I use a vector of bullet objects in my player/character class and as long as it's a shooter I think it's perfectly fine
Re: Entity System
Hehe, makes sense...GroundUpEngine wrote:Heres my input, I use a vector of bullet objects in my player/character class and as long as it's a shooter I think it's perfectly fine
It was just I thought of something that would be in my game last night right before I fell asleep, and then I thought about how to actually implement it, and how it moved and such... Then I woke up and forgot what it was... I just can't remember what it is, and where it would fit >.>
- GroundUpEngine
- Chaos Rift Devotee
- Posts: 835
- Joined: Sun Nov 08, 2009 2:01 pm
- Current Project: mixture
- Favorite Gaming Platforms: PC
- Programming Language of Choice: C++
- Location: UK
Re: Entity System
Cool. Hey ya think that's bad, I got all this crap that I wrote last night to try make sense of
Code: Select all
class Entity;
Code: Select all
class Actor : public Entity;
class Object : public Entity;
class GUI : public Entity;
class Text : public Entity;
Code: Select all
class Player : public Actor;
class Enemy : public Actor;
// Player & Enemy has vector<Bullet>
class Vehicle : public Actor;
class Bullet : public Object; // hmm
class Item : public Object;
class Map; // Map has vector<Object*>
// e.g. Map->Object[i] = new Object;
class Console : public GUI;
class Textbox : public GUI;
Code: Select all
class Pushable : public Object;
// e.g. Map->Object[i] = new Pushable;
Re: Entity System
Haha... That's why I always draw some flow charts =D - They usually help explain crap like that to me >.>
Re: Entity System
Same, and if I come up with a solution at night, I can't sleep until I write it down...XianForce wrote:Haha... That's why I always draw some flow charts =D - They usually help explain crap like that to me >.>
Re: Entity System
Unfortunately, my ideas come when I'm almost asleep - So I usually tell myself that I'll write it down in the morning, but then I forget >.>eatcomics wrote:Same, and if I come up with a solution at night, I can't sleep until I write it down...XianForce wrote:Haha... That's why I always draw some flow charts =D - They usually help explain crap like that to me >.>