summary refs log tree commit diff
path: root/lib/entity.fnl
diff options
context:
space:
mode:
authorequa <equaa@protonmail.com>2021-04-18 20:22:20 -0500
committerequa <equaa@protonmail.com>2021-04-18 20:42:59 -0500
commitca870dab91daee38b8d55ac6d2f2b4fd6959c6ac (patch)
tree1b0445da67552162eac4e72e39330a777af7f7b6 /lib/entity.fnl
parent78530480d35be5dbb57f1a264147bec48d6cf800 (diff)
entities et al
Diffstat (limited to 'lib/entity.fnl')
-rw-r--r--lib/entity.fnl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/entity.fnl b/lib/entity.fnl
new file mode 100644
index 0000000..2032e65
--- /dev/null
+++ b/lib/entity.fnl
@@ -0,0 +1,12 @@
+(local proto (require :lib.proto))
+
+{:init (proto.table-method :entity.init)
+ :position (proto.table-value :entity.position)
+ :velocity (proto.table-value :entity.velocity)
+ ;; [self game {: up : down : left : right}]
+ :steer (proto.meta-method :entity.velocity)
+ ;; [self game]
+ ;; screen origin at center of entity, 1 = 1 pixel (for now)
+ :draw (proto.meta-method :entity.draw)
+ ;; [self game pos]
+ :collide (proto.meta-method-opt :entity.collide)}