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

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -