public void paint(Graphics g)
    {
      Graphics2D g2d = (Graphics2D) g;

      g2d.setColor(Color.black);
      g2d.fillRect(0, 0, 320, 200);

      DrawMap(g2d);
      DrawGateways(g2d);
      DrawEnemies(g2d);
      DrawBullets(g2d);
      DrawPlayer(g2d);
      DoFallDown();

      DoGarbageCollectBullets();

      DoMoveEnemies(); 

      boolean bulletcollision = DoBulletCollision();
    
      boolean gatewaycollision = DoGatewayCollision();
      if (gatewaycollision) {

	player.setxy(currentgateway.getplayerx(),currentgateway.getplayery());
	map.setxy(currentgateway.getmapx(),currentgateway.getmapy());

	switch(currentgateway.getnewlevel()) {
		case 1000:
			loadlevel1000();
			break;
		case 2000:
			loadlevel2000();
			break;
		default:
			loadlevel1000();
			break;
		}
	}

      DoMoveBullets();

	//g2d.drawImage("pics/player-right-40x40-1.png",100,100,this);
      Toolkit.getDefaultToolkit().sync();
      g.dispose();

    }