Skip to content

v0.1.0 Docs, Tests, Bug Fixes, Better tweens

Compare
Choose a tag to compare
@AlecTroemel AlecTroemel released this 16 Sep 19:29
· 95 commits to main since this release
  • #31 Components have been completely refactored to use spork/schema for more feature rich typing. add-componet and add-entity could then be refactored to be plain fn's and greatly simplified! Additionally you can set components to variables before using them in add-entity.
# only syntax that ever worked
(add-entity world (position :x 100.0 :y 100.0))

# This would not work, but is now possible with this refactor!
(let [pos (position :x 100.0 :y 100.0)] 
  (add-entity world pos))

# you can even do this!
(defn centered-position [v] (position :x v :y v))
(add-entity world (centered-position 100.0)) # this entitty will have the component "position" 
  • #34 Refactored tweens to be components, which allows adding any number of them to a single entity!
(def-component example-cmp
    :a :number            # can only tween numbers
    :b (props :c :number) # nested objects of numbers are tweened recursively
    :d :string)           # anything other then numbers are ignored

(tweens/create wld ent :example-cmp
    :to {:a 10 :b {:c 34}} # could also use the component fn, but defining unused string seemed wrong.
    :with tweens/in-cubic
    :duration 10)          # take 10 Ticks of the ecs to complete
  • #30 + #33 Tests for all the things, plus a gitlab pipeline to run them
  • #26 detailed doc strings for all the modules and their public functions
  • fixed an off by 1 error in querying the db when there is only 1 entity with a component
  • deleting an entity no longer clears ever key in the cache
  • A fun logo in the readme