Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int current = 0;
- int dir = 1;
- /* ... */
- void draw() {
- /* ... */
- current += dir;
- if (current <= 0
- || current >= frames.length - 1) {
- dir *= -1;
- }
- image(frames[current],
- 0, 0, 128, 128);
- }
- /* ... */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement