Skip to content

Instantly share code, notes, and snippets.

@rcurtis
Created September 6, 2016 14:49
Show Gist options
  • Save rcurtis/2e69817fe250f51a7b4d4bc7f5da620d to your computer and use it in GitHub Desktop.
Save rcurtis/2e69817fe250f51a7b4d4bc7f5da620d to your computer and use it in GitHub Desktop.
#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