simple questions
i've been looking around and learning, enough to make a simple game, this is what i've got so far.
import java.applet.*;
import java.awt.*;
import java.awt.image.*;
import java.awt.event.*;
publicclass Correextends Appletimplements Runnable, MouseMotionListener
{
int ancho = 500;// Ancho del applet
int alto = 500;// Alto del applet
int naveX = 120;// Coordenada X de la nave
int naveY = 120;// Coordenada Y de la nave
Thread hiloJuego;// El hilo...
Image nave;// Imagen para la nave
Graphics2D bufferdImgSurface;// Variables graficas para
BufferedImage bufferdImg;// usar double buffer
publicvoid start()
{
Thread hiloJuego =new Thread(this);
hiloJuego.start();
}
publicvoid init()
{
nave = getImage(getDocumentBase(),"rType.gif");
bufferdImg = (BufferedImage)createImage(ancho, alto);
bufferdImgSurface = bufferdImg.createGraphics();
addMouseMotionListener(this);
}
publicvoid run()
{
while(true)// Comienza el ciclo
{
repaint();// Redibuja la pantalla en cada ciclo
}
}
publicvoid paint(Graphics g)
{
update(g);
}
publicvoid update(Graphics g)
{
Graphics2D g2 = (Graphics2D)g;
// Color de fondo.
bufferdImgSurface.setBackground(Color.black);
// Limpia el applet.
bufferdImgSurface.clearRect(0, 0, ancho, alto);
// Dibuja la nave en posicion actual.
bufferdImgSurface.drawImage(nave, naveX, naveY,this);
// Dibuja todo lo anterior en pantalla
g2.drawImage(bufferdImg, 0, 0,this);
}
publicvoid mouseMoved(MouseEvent e){ naveX=e.getX(); naveY=e.getY();}
publicvoid mouseDragged(MouseEvent e){ naveX=e.getX(); naveY=e.getY();}
publicvoid mouseReleased(MouseEvent e){}
}
Okay, so it's just only a ship that can be controled by the mouse on a black background, it's not much, I know...(still impressive for someone that didn't know what an applet was a week ago).
my questions:
1.When I move the ship the mouse pointer covers it, any way i can make the arrow go away?
2.Is there any special method to put a background image or can I just put it there like i put the ship(i'm plannig to put an animated gif, so it gives you a sense of movement).
3. this has nothing to do with programming, but i'm making this game after an old atari game where you controlled a rocket and you had to dodge stuff(the rocket didn't shoot). anyone remembers the name of that game?

