Skip to content

Instantly share code, notes, and snippets.

@felixyz
Created August 3, 2017 01:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felixyz/74ca89d1196131e9f1de09e70dba3503 to your computer and use it in GitHub Desktop.
Save felixyz/74ca89d1196131e9f1de09e70dba3503 to your computer and use it in GitHub Desktop.
```
commit
[#world tick: 0]
[#time #system/timer resolution: 1000]
[#thing value: 1 delta: 1]
```
Update
~~~
search
thing = [#thing value delta]
value > 5
delta > 0
commit
thing.delta := delta * -1.1
~~~
~~~
search
thing = [#thing value delta]
value < 1
delta < 0
commit
thing.delta := delta * -1.1
~~~
~~~
search
[#time second]
world.tick != second
thing = [#thing]
commit
world.tick := second
thing <- [value: thing.value + thing.delta]
~~~
~~~
search
world = [#world]
thing = [#thing]
bind
[#ui/text text: "value:{{thing.value}}, delta: {{thing.delta}}"]
~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment