Entity Component System, weapon

Posted by Heorhiy on Game Development See other posts from Game Development or by Heorhiy
Published on 2013-11-02T22:13:58Z Indexed on 2013/11/02 22:19 UTC
Read the original article Hit count: 410

I'm new to game programming and currently trying to understand Entity Component System design by implementing simple 2d game. By ECS I mean design, described here for example

In my game I have different kind of weapons: automatic, gun, grenade, etc... Each type of weapon has it's own affect area (gun shots along the straight line and grenade explodes and covers some spherical area) , damage impact, visual effect and bullet amount, delay between shots. So I don't completely understand how to implement weapons. Should weapon be an Entity or it should be a component? And how the player should pick up a weapon, switch between different types of weapons and etc.

© Game Development or respective owner

Related posts about component-based

Related posts about entity-system