SkillAble and Skill InterFace

if u have character or npc with skill i think this is a good interface for u:



[java]

public interface SkillAble {

public void addSkill(Skill Skill);

public void removeSkill(Skill Skill);

public void removeSkill(int skillNum);

public void activateSkill(int skillNum);

public void removeAllSkills();



}[/java]



and the skill interfface of course



[java]

public interface Skill {

public void activateSkill(Spatial spatial );



}

[/java]

Heres a good interface to add stuff:

[java]

public interface StuffContainer {

public int addStuff(Object stuff);

public Object getStuff(int id);

}

[/java]

(its also better than yours cause you actually know the id’s :roll:)

the idea is to allow the programmer to write new skills for npc or character by implemnting skill and his only method the metthod argument spatial is the spatial that activated the skill

With Artemis:

[java]Entity ent = world.createEntity();

ent.addComponent(new HealthComponent(100));

ent.addComponent(new StaminaComponent(100));

ent.refresh();[/java] If the player doesn’t need stamina don’t give them a stamina component or remove the StaminaComponent’s system processor from the world SystemManager.

… point is that this stuff is really relatively implementation specific, especially when theres methods with specific names like “skill”, “move” etc. in Interfaces. An entity system like the one shown by @squizzle would be more generic. Even the existing system of Controls and AppStates is more flexible and avoids the lockup that comes with extension and using language features as programming patterns. Our documentations best practices section covers some of these topics.

kk got it .





anyway my first game project is closing to the alpha-beta stage it’s a simple 4-d platformer and i’m building it in a way that i seperate data from controls.for example ,when i build a level i just insert dataTypes to spatials and then when the game starts it puts on the spatials the controls textures animation sounds and later the model also.