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
Post a Comment