#include "testApp.h"


//--------------------------------------------------------------
void testApp::setup(){
	max_leaves = 10;
}

//--------------------------------------------------------------
void testApp::update(){
	while(leaves.size() < max_leaves){
		fallingLeaf leaf = fallingLeaf();
		leaves.push_back(leaf);
	}
	
	for(int i = 0; i < leaves.size(); i++){
		leaves[i].update();
		if(leaves[i].isOnGround() == true){
			fallingLeaf leaf = fallingLeaf();
			leaves[i] = leaf;
		}
	}
}

//--------------------------------------------------------------
void testApp::draw(){
	ofBackground(255,255,255);
	for(int i = 0; i < leaves.size(); i++){
		leaves[i].draw();
	}
}

//--------------------------------------------------------------
void testApp::keyPressed  (int key){ 
	
}

//--------------------------------------------------------------
void testApp::keyReleased  (int key){ 
	
}

//--------------------------------------------------------------
void testApp::mouseMoved(int x, int y ){
}

//--------------------------------------------------------------
void testApp::mouseDragged(int x, int y, int button){
}

//--------------------------------------------------------------
void testApp::mousePressed(int x, int y, int button){
}

//--------------------------------------------------------------
void testApp::mouseReleased(){

}
