void tick(){
		if (playing) {
			//handles speedboost powerup
			if (speedTimer > 0) 
				speedTimer--;
			else if (speedTimer == 0) {
				Square head = square.get(square.size() - 1);
				SQUARE_VELOCITY /= 2;
				head.v_x /= 2;
				head.v_y /= 2;
				speedTimer--;
			}
			//Delete the last square and add a new one to the head
			Square prevHead = square.get(square.size() - 1);
			Square newHead = new Square(getNewX(prevHead), getNewY(prevHead),
					prevHead.v_x, prevHead.v_y, 
					COURT_WIDTH, COURT_HEIGHT); 
			square.remove(0);
			square.add(newHead);
		//	System.out.println("pos_x: " + newHead.pos_x + " pos_y: " + newHead.pos_y + 
			//		" v_x: " + newHead.v_x + " v_y: " + newHead.v_y + " num of squares: " + square.size());
			
			ate = false;
			//update location of the snitch
			snitch.move();

			// make the snitch bounce off walls...
			snitch.bounce(snitch.hitWall());
			// ...and the mushroom
			snitch.bounce(snitch.hitObj(food));
		
			// check game end condition... hit wall
			for (int i = 0; i < walls.size(); i++) {
				if (square.get(square.size() - 1).willIntersect(walls.get(i))) { 
				loser();
				}
			}
			// check more game end conditions, hit border or itself
			if (selfIntersect()) { 
				loser();
			} else if (square.get(square.size() - 1).hitWall() instanceof Direction) {
				loser();
			}// check for point winning conditions
			else if (square.get(square.size()-1).intersects(food)) {
				winner();
			} // check for power-up conditions
			else if (square.get(square.size() - 1).willIntersect(snitch)) {
				powerUp();
			}

			// update the displays
			repaint();
		}
	}