PatysBlog

Czarodziej JavaScript, Poliglota, Miłośnik Podróży

The beauty of Entity Component System and Command Pattern

Entity Component System and Command Pattern

Entity Component System…

Recently I decided to use ECS (Entity Component System). I wanted to create RTS after many fails. Yeah, I tried so many times that I can’t even count. I love strategy games and I will create one someday. So the time for ECS came and I started to go deeper. I found it pretty useful and I started creating simple game for a programming compo. It’s the “Szalone Mikołaje 2” – here on github: https://github.com/Patys/Szalone-Mikolaje-2

Why…

I love it. I simply create some components. It will store data. Then systems. What they do? They take entities(boxes) filled with components (data) and do some things (algorithms).

And Command Pattern comes…

Ones I needed something which will help me fast create some entities in different places of code. I was searching and I found this: http://gameprogrammingpatterns.com/command.html This was exactly what I was looking for. It improved my code.

How to use it together…

So I have entities (boxes) filled with components (data) and systems (algorithms) process them. And here comes command pattern. I want to create new entity with some components and initialize them all with some values. I just use command and done.

Next…

I will create a technical tutorial about using it later. (I hope)

But for now, see you 🙂

Please follow and like us:
0
« »

© 2017 PatysBlog. Theme by Anders Norén.