Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Created May 16, 2013 00:35
Show Gist options
  • Save fowlmouth/5588575 to your computer and use it in GitHub Desktop.
Save fowlmouth/5588575 to your computer and use it in GitHub Desktop.
import fowltek/entitty
entitty_imports
import fowltek/vector_math
type Pos = Tvector2[float]
type Vel = object
vec: TVector2[float]
Pos.setInitializer proc(x: PEntity) =
x[Pos].x = 42.0
x[Pos].y = 99.0
var em = newEntityManager()
var e1 = em.newEntity(Pos, Vel)
echo "entity1 is at ", $ e1[Pos]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment