Skip to content

Instantly share code, notes, and snippets.

@felipecustodio
Created November 2, 2018 16:37
Show Gist options
  • Select an option

  • Save felipecustodio/6b2d20473156dbe4b3d85faf40dd1442 to your computer and use it in GitHub Desktop.

Select an option

Save felipecustodio/6b2d20473156dbe4b3d85faf40dd1442 to your computer and use it in GitHub Desktop.
increase / decrease a value smoothly after certain thresholds are met
if (thickness_flag) {
thickness += 1;
if (thickness >= 5) {
thickness_flag = false;
}
} else {
thickness -= 1;
if (thickness <= 1) {
thickness_flag = true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment