Doménový Model
Presentační Model
Fyzikální model
AI model
Networking model


Chessmaster 2000 (1986)

Chessmaster 11 (2007)
| Chessmaster 2000 | Chessmaster 11 | |
|---|---|---|
| Doménový model | Herní deska, figurky, čas, pravidla | Herní deska, figurky, čas, pravidla |
| Presentační model | CGA sprity, beeper zvuky | Animované 3D objekty, zvuky, hudba |
| Fyzikální model | Není | Rigidbody engine |
| AI model | Engine Davida Kittingera | King engine |
| Networking model | Není | Posílání tahů |

Heroes of Might and Magic







Shrnutí

Entity
Component
System
Attribute

Root
Maze
GameSystem
BoxBehavior
PacmanBehavior
GhostBehavior

Modifikací stavu herního objektu
Přímým voláním
Pomocí message brokeru
Unicast
Multicast
Broadcast
| 1 | public interface ICustomMessageTarget : IEventSystemHandler |
| 2 | { |
| 3 | // functions that can be called via the messaging system |
| 4 | void Message1(); |
| 5 | void Message2(); |
| 6 | } |
| 7 | |
| 8 | public class CustomMessageTarget : MonoBehaviour, ICustomMessageTarget |
| 9 | { |
| 10 | public void Message1() |
| 11 | { |
| 12 | // handle message |
| 13 | } |
| 14 | |
| 15 | public void Message2() |
| 16 | { |
| 17 | // handle message |
| 18 | } |
| 19 | } |
| 20 | |
| 21 | // sending message |
| 22 | ExecuteEvents.Execute<ICustomMessageTarget>(target, null, (x,y) => x.Message1()); |

Artemis framework
Atomic Game Engine
Unity
Unreal Engine
Godot Engine

| 1 | // new component |
| 2 | public class Health extends Component { |
| 3 | public int health; |
| 4 | public int damage; |
| 5 | } |
| 6 | |
| 7 | // new archetype |
| 8 | Archetype dragonArchetype = |
| 9 | new ArchetypeBuilder() |
| 10 | .add(Flaming.class).add(Health.class).build(world); |
| 11 | |
| 12 | public class MovementSystem extends EntityProcessingSystem { |
| 13 | public MovementSystem() { super(Aspect.all(Position.class, Velocity.class)); } |
| 14 | } |
| 15 | |
| 16 | // create new transmuter |
| 17 | this.transmuter = new EntityTransmuterFactory(world) |
| 18 | .add(FrozenFlame.class).remove(Flaming.class).build(); |
| 19 | |
| 20 | // apply transformation to entity |
| 21 | this.transmuter.transmute(entity); |


| 1 | // RocketComponent |
| 2 | void OnTriggerEnter2D (Collider2D col) { |
| 3 | // If it hits an enemy... |
| 4 | if(col.tag == "Enemy") { |
| 5 | // ... find the Enemy script and call the Hurt function. |
| 6 | col.gameObject.GetComponent<Enemy>().Hurt(); |
| 7 | // Call the explosion instantiation. |
| 8 | OnExplode(); |
| 9 | // Destroy the rocket. |
| 10 | Destroy (gameObject); |
| 11 | } |
| 12 | // Otherwise if it hits a bomb crate... |
| 13 | else if(col.tag == "BombPickup") { |
| 14 | // ... find the Bomb script and call the Explode function. |
| 15 | col.gameObject.GetComponent<Bomb>().Explode(); |
| 16 | |
| 17 | // Destroy the bomb crate. |
| 18 | Destroy (col.transform.root.gameObject); |
| 19 | |
| 20 | // Destroy the rocket. |
| 21 | Destroy (gameObject); |
| 22 | } |
| 23 | } |
EnTT
Entitas
A-Frame
ECSY
| 1 | var world = new World(); |
| 2 | world |
| 3 | .registerSystem(MoveSystem) |
| 4 | .registerSystem(RendererSystem); |
| 5 | |
| 6 | class MoveSystem extends System { |
| 7 | execute(delta, time) { |
| 8 | this.queries.moving.results.forEach(entity => { |
| 9 | let pos = entity.getMutableComponent(Position); |
| 10 | pos.x += entity.getComponent(Velocity).x; |
| 11 | }); |
| 12 | } |
| 13 | } |

Ve všech strategiích je nejdůležitější Primalex - kdy vám voják s kýblem barvy přebarví budovy na vaší frakci, a ten nepřítel pak do nich nemůže vlézt.Recenzenti ze Score