Quantcast
Channel: GameDev.net
Viewing all articles
Browse latest Browse all 17063

ECS in Java

$
0
0

 I was making a game  (2D RPG) in java using libGDX. Started making classes Top Down aka Thing →  Item → Animated Item → DirectionalAnimatedItem → Weapon → MeeleWeapon → MetalMeeleWeapon → Sword → FireSword → SuperFireSword → DeamonsSword. This quickely became a  nightmare  so I  moved everything into nice packages and it became less of nightmare, but still a nightmare none the less. After much refractoring I  realized  that no class beyond MeeleWeapon was needed. So away they went.  I replaced the damage  methods with functional interfaces  that one could extend  and use  to set the various methods for functionally of objects and what did when various things …


Viewing all articles
Browse latest Browse all 17063

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>