Kind of Shoot’em Up for testing Entity / Component data driven system

septes1

After learn the basics of Unity3D development I wondered how to port this idea to a raw code. Yes, I know that a component system is not a Unity idea but I never used it before.

I developed a simple shoot’em up using c++ and OpenGL in order to learn about a basic component system. Most of the “game” can be configured without coding anything. Just editing some configuration files. I have a file for level order, file for each level settings like timeline, enemies to spawn… I have another file for each entity where you can add or remove components and some additional stuff. About component itself I only added some simple functionality like colliders, animation, simple movement, spline movement … septes2 An example of these files (simple enemy configuration) :

<Entity ID="Enemy01" Type="Dynamic">
 <Component Type="CmpAnimation" img="data/img/playermov.png" hframes="28" vframes="1" ScaleY="-1">
 <anim Type="idle" ini="6" end="7" default="1" />
 <anim Type="leftmov" ini="0" end="5" oneshoot="1" reverse="1"/>
 <anim Type="rightmov" ini="8" end="13" oneshoot="1" reverse="1" />
 <anim Type="end" ini="14" end="25" />
 </Component>

 <Component Type="CmpSplineMov" loop="1" slowness="5">
 <point x="1050" y="100" />
 <point x="800" y="200" />
 <point x="400" y="100" />
 <point x="200" y="400" />
 <point x="-50" y="100" />
 </Component>

 <Component Type="CmpFaction" faction="Enemy" />

 <Component Type="CmpLife" value="4" />

 <Component Type="CmpDamageDealer" value="1" />

 <Component Type="CmpCollider" >
 <factionToCol faction="Player"/>
 </Component> 

</Entity>

it was very fun doing this 🙂

Anuncios

Responder

Introduce tus datos o haz clic en un icono para iniciar sesión:

Logo de WordPress.com

Estás comentando usando tu cuenta de WordPress.com. Cerrar sesión / Cambiar )

Imagen de Twitter

Estás comentando usando tu cuenta de Twitter. Cerrar sesión / Cambiar )

Foto de Facebook

Estás comentando usando tu cuenta de Facebook. Cerrar sesión / Cambiar )

Google+ photo

Estás comentando usando tu cuenta de Google+. Cerrar sesión / Cambiar )

Conectando a %s