7.3.2 During Update

Respond to keyboard input:

 
if(Kb.bp(KB_SPACE)) { 
  circles.New().set(  RandomF(0.05, 0.2) 
                    , RandomF(-D.w(), D.w()) 
                    , RandomF(-D.h(), D.h()) 
5  ); 
}  

Use the mouse position:

 
if(Ms.bp(0)) { 
  circles.New().set(0.05, Ms.pos()); 
}  

With a timer:

 
Flt timer = 3; // Put this line on top of the file. 
 
// These lines belong in Update() 
if(timer > 0) timer -= Time.d(); 
5else { 
  timer = 3; 
  circles.New().set(  RandomF(0.05, 0.2) 
                    , RandomF(-D.w(), D.w()) 
                    , RandomF(-D.h(), D.h()) 
10  ); 
}  

Exercise
Test all of the examples above and make sure you understand every one of them. Always add code to display all elements on the screen.