These are chat archives for selfsame/hard

29th
Jun 2018
abnunez
@abnunez
Jun 29 2018 14:22
There's a room for your lib?! All the pain I've put myself through figuring stuff out... Lol
Joseph Parker
@selfsame
Jun 29 2018 14:23
haha yeah, feel free to put questions about hard/tween here
abnunez
@abnunez
Jun 29 2018 14:28
I most definitely will. Tween has given me a hell of a time but I'll have to be at home to ask specifics. I think my problems stem from trying to use it within update loops and it becomes infinite. From what I've gathered, it's best used at the top level where it's only possiblly called once?
Joseph Parker
@selfsame
Jun 29 2018 14:29
@abnunez yeah a timeline is basically an update loop
also you have to make sure that timeline functions return false/nil when they're ready to move on
so like (timeline* (wait 1.0) (fn [] (instantiate :cube) nil)), without the nil it would keep instantiating cubes forever
abnunez
@abnunez
Jun 29 2018 14:31
Ooooooo
Rip
So if it's an update loops itself then how do you normally integrate it into gameplay? Like typically I have some event that triggered, is checked for in an update loop, and then try to call timeline to do something (like wait for an enemy attack animation to finish then move to next then). I ended up solving my problem using tags but I feel like timeline could be super handy.
Move to next turn**
Joseph Parker
@selfsame
Jun 29 2018 14:38
I would probably move the timeline to the event trigger, and at the end of the timeline update whatever data has finally changed
but yeah you could also toggle an :isMoving bool or something