henne90gen / yap

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Yet Another Portal

Story

  • house at night
  • try to get to the fridge to get food
  • don't get caught by your parents
  • otherwise you are grounded for two weeks
  • scenarios
    • normal house
    • orphanage
    • hospital?
    • prison?
    • forest?
    • parking lot? (fast cars that can run you over)

Entity Component System

  • Entity
    • a collection of components that represents a thing in the game
  • Component
    • a piece of data
  • System
    • logic that operates on a certain set of entities
  • Capability
    • collection of components
    • systems require capabilities from entities
    • entities inherently have capabilities, because they consist of components

Operations that should be possible

  • iterate over all entities
  • iterate over all entities that have a certain capability
  • remove an entity and associated entry from the lists in entityMap
    • remove from entityList
    • find out which capabilities in capabilityMap match the components of the entity and delete the entity from those lists
  • add entity
    • add components
    • iterate all capabilities in capabilityMap and add it to the ones that have matching components
  • add component to entity
    • check that component does not exist already
    • just add component
    • check capabilityMap for new matching capabilities and add the entity to those lists
  • remove component from entity
    • similar to removing an entity

About


Languages

Language:Kotlin 99.0%Language:GLSL 0.8%Language:Java 0.2%