Resetting the scene in processing by pressing any button -


does know how reset scene when key pressed after animation done. want use method:

void keypressed() {   //what code?  } 

but not know code put inside make scene reset. can help?

you have store "scene" in variables. reset scene, reset variables.

here's simple example shows moving ball resets when press key:

int ballx = 0;  void setup() {   size(500, 100); }  void keypressed() {   ballx = 0; }  void draw() {   background(0);   ballx++;   ellipse(ballx, height/2, 10, 10); } 

your real "scene" has more 1 variable, idea same. store "scene" in variables, , reset variables when want reset scene.


Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -