Tag Info

New answers tagged

0

Your implementation is a bit off of the other Entity-Component systems I've seen. I recommend taking a look at EntityX. It should give a good idea of what a working implementation looks like. You could also read these which may help: Role of systems in entity systems architecture Component - Game Programming Patterns Understanding ...


1

ECS doesn't make miracles and not all the problems should be solved by it. In some point you will need especific code about the specific logic of your game. You can put an "Invulnerable" flag inside your health component and a flag "PenetrateInvulnerability" inside the atack message and your system combat manage then.


1

Note: I'm playing fast and loose with the pseudocode here, so let me know if anything is unclear. Ideally, the player shouldn't be special - just another set of components. The main function of entities is to group components. You might think of it this way: components get updates, not entities. From the good old Evolve Your Hierarchy article: Updates ...


2

While the answer posted @dnk drone.vs.drones is technically exactly about what you asked for and a viable solution, here is another suggestion that goes a bit further, and is based on my comment on your question. I'm assuming: the card effects are quite small and generic, and act on either the player or the opponent the game is played against an opponent, ...


2

I 'll try this aproach: I'm lazy so I included the factory inside the class card. I suggest using delegates to forge the behaviour of each card type, and a big and maybe brute, swith case inside the factory method (createCard). public class card{ private int ID; private string cardName;//getters setters? private Texture2D ...



Top 50 recent answers are included