Skip to content

Instantly share code, notes, and snippets.

@rcurtis
Created September 6, 2016 14:49
#include "tweeny.h"
#include <cstdio>
bool print(tweeny::tween<int> &, int x) {
printf("%d\n", x); return false;
}
void main()
{
printf("infinite loop example\n");
auto infinitetween = tweeny::from(0).to(100).during(5).onStep(print);
infinitetween.onStep([](tweeny::tween<int> & t, int) { if (t.progress() >= 1.0f) t.seek(0); return false; });
for (int i = 0; i <= 20; i++) infinitetween.step(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment