@Override
	public void paintComponent(Graphics g) {
		super.paintComponent(g); // Paint background, border
		//------------ Collision detection
		//Check the pellets
		roundCheck(1);//pellets single and doubleshots
		//Rocket check
		roundCheck(0);//0 is rockets
		//check the takeover rockets
		roundCheck(3);
		//------------Drawing
		
		// Draw the balls.
		for (Ball b : Data.m_balls) {
			if (b.painted){
			b.draw(g,Color.BLUE);
			}
			else {
				b.draw(g, Color.BLACK);
			}
		}
		// Draw the gun
		m_gun.draw(g);
		// Draw all flying pellets
		for (Pellet p : Data.p_list) {
			p.draw(g);
		}
		//Draw the rockets
		for (Rocket r:Data.r_list) {
			r.draw(g);
		}
		for (TakeOverRocket tar:Data.tar_list) {
			tar.draw(g);
		}		
		//Draw the explosion particles
		for(Explosion expl : Data.exp_list){
			for(Pellet pExplosion:expl.explosionParticles){
				 if((int)(Math.random()*10)>5){
					 g.setColor(Color.red);
				 }else{
					 g.setColor(Color.yellow); 
				 }
				 pExplosion.draw(g);	
			}
		}
	}