<DIV>hi<BR>i'm saleh<BR>i want it so imediatly please guid me<BR> <BR>my program shuld have a thread that<BR> the 4 or more ducky picture fly in sky<BR>then 1 gun exist in button of picture that <BR>it change place which time then with<BR>press the (space key) shut the bird<BR>then give him point<BR> <BR>and have a background from nature that move by the time<BR>thanks from your giving answer to me<BR>bye</DIV>
<DIV> <BR> Gun Pro</DIV>
<DIV>package tamrin;<BR>import java.awt.*;<BR>import java.awt.event.*;<BR>import java.applet.*;<BR>public class test2 extends Applet {<BR> int c = 225, d = 260,v=620;<BR> int a = 293, b = 530,bb=530;<BR> int p = 220, q = 640;<BR> int n, m, i;<BR> public void init() {<BR> n = (int) (Math.random() * 660 - 100);<BR> m = (int) (Math.random() * 350 - 100);<BR> this.setSize(600, 670);<BR> this.setBackground(Color.CYAN);<BR> }<BR> public void paint(Graphics screen) {<BR> Graphics2D screen2D = (Graphics2D) screen;<BR> screen2D.setColor(Color.RED);<BR> screen2D.fillOval(a,
bb,15,15);<BR> screen2D.setColor(Color.BLACK);<BR> screen2D.fillRoundRect(a, b, 15, 150, 10, 10);<BR> screen2D.fillRoundRect(p, q, 160, 160, 15, 15);<BR> screen2D.fillOval(c,v,150,150);<BR> }<BR> public test2() {<BR> try {<BR> jbInit();<BR> } catch (Exception e) {<BR> e.printStackTrace();<BR> }<BR> }<BR>
private void jbInit() throws Exception {<BR> this.addKeyListener(new test2_this_keyAdapter(this));<BR> }<BR> void this_keyPressed(KeyEvent e) {<BR> if (e.getKeyCode() == e.VK_RIGHT) {<BR> a += 10;<BR> // b += 10;<BR> c += 10;<BR> // d += 10;<BR> p += 10;<BR>
// q += 10;<BR> }<BR> if (e.getKeyCode() == e.VK_SPACE) {<BR> while(bb==0){<BR> bb -= 10;<BR> }<BR> }<BR> if (e.getKeyCode() == e.VK_LEFT) {<BR> // while (a == 2) {<BR> a -=
10;<BR> // b-=10;<BR> c-=10;<BR> // d-=10;<BR> // q-=10;<BR> p -= 10;<BR> // }<BR> }<BR> repaint();<BR> }<BR>
}</DIV>
<DIV> class test2_this_keyAdapter extends java.awt.event.KeyAdapter {<BR> test2 adaptee;<BR> test2_this_keyAdapter(test2 adaptee) {<BR> this.adaptee = adaptee;<BR> }<BR> public void keyPressed(KeyEvent e) {<BR> adaptee.this_keyPressed(e);<BR> }</DIV>
<DIV>}<BR>************************************************************************************************************</DIV>
<DIV> Main pro</DIV>
<DIV>package tamrin;<BR>import java.awt.*;<BR>import java.awt.event.*;<BR>import java.applet.*;<BR>import javax.swing.*;<BR>public class asl extends Applet implements Runnable {<BR> int c = 290, d = 300;<BR> AudioClip a1;<BR> int n, m, i;<BR> Thread t = new Thread(this);<BR> Image picture[] = new Image[5];<BR> int totalpic = 0;<BR> int current = 0;<BR> int pause = 500;<BR> String imgText;<BR>//*************************************************<BR> public void init() {<BR> n = (int) (Math.random() * 660 - 100);<BR> m = (int) (Math.random() * 350 - 100);<BR> this.setSize(600, 670);<BR>
this.setBackground(Color.CYAN);<BR> t.start();<BR> a1 = getAudioClip(getDocumentBase(), "4.au");<BR> // a loop for give the pictures<BR> for (i = 1; i <= picture.length; i++) {<BR> picture[i] = this.getImage(this.getCodeBase(), "i.jpg");<BR> }<BR> String pauseText = null;<BR> pause = Integer.parseInt(pauseText);<BR> for (i = 0; i < 6; i++) {<BR> imgText = getParameter("image" + i);<BR> if
(imgText != null) {<BR> totalpic++;<BR> picture[i] = this.getImage(this.getCodeBase(), imgText);<BR> } else {<BR> totalpic++;<BR> }<BR> }<BR> }<BR>//**********************************************<BR> public void paint(Graphics screen) {<BR> Graphics2D screen2D = (Graphics2D) screen;<BR> if (picture[i] != null)
{<BR> screen2D.drawImage(picture[current], 0, 0, this);<BR> }<BR> screen2D.fillOval(225, 620, 150, 150);<BR> screen2D.setColor(Color.red);<BR> screen2D.fillOval(c, d, 20, 20); // c=290 , d=300<BR> screen2D.setColor(Color.BLACK);<BR> screen2D.fillRoundRect(293, 530, 15, 150, 10, 10);<BR> for (i = 0; i < 5; i++) {<BR> screen2D.drawImage(picture[i], m, n, 60, 40, this);<BR> }<BR>
}<BR>//**********************************************<BR> public void start() {<BR> if (t == null) {<BR> t = new Thread(this);<BR> t.start();<BR> }<BR> }<BR>//*********************************************<BR> public void run() {<BR> Thread thisTread = Thread.currentThread();<BR> while (t == thisTread) {<BR> current++;<BR> if (current >= totalpic)
{<BR> current = 0;<BR> }<BR> a1.play();<BR> m += 10;<BR> d -= 10;<BR> if (d == 0) {<BR> d = 300;<BR> }<BR> if (m == 600) {<BR> m =
0;<BR> }<BR> try {<BR> t.sleep(pause);<BR> } catch (InterruptedException ex) {<BR> }<BR> repaint();<BR> if (c == m && d == n) {<BR> picture[i] = null;<BR> }<BR> //
repaint();<BR> try {<BR> t.sleep(50);<BR> } catch (InterruptedException ex) {<BR> }<BR> repaint();<BR> }<BR> }<BR>//*************************************************<BR> /* <BR> public asl() {<BR> try {<BR> jbInit();<BR> } catch (Exception
e) {<BR> e.printStackTrace();<BR> }<BR> }<BR> private void jbInit() throws Exception {<BR> this.addKeyListener(new asl_this_keyAdapter(this));<BR> }<BR> void this_keyPressed(KeyEvent e) {<BR> if (e.getKeyCode() == e.VK_RIGHT) {<BR> a += 10;<BR> // b += 10;<BR> c +=
10;<BR> // d += 10;<BR> p += 10;<BR> // q += 10;<BR> }<BR> if (e.getKeyCode() == e.VK_SPACE) {<BR> while(bb==0){<BR> bb -= 10;<BR> }<BR> }<BR> if (e.getKeyCode() == e.VK_LEFT)
{<BR> // while (a == 2) {<BR> a -= 10;<BR> // b-=10;<BR> c-=10;<BR> // d-=10;<BR> // q-=10;<BR> p -= 10;<BR>
// }<BR> }<BR> repaint();<BR> }<BR> }</DIV>
<DIV> class asl_this_keyAdapter extends java.awt.event.KeyAdapter {<BR> asl adaptee;<BR> asl_this_keyAdapter(asl adaptee) {<BR> this.adaptee = adaptee;<BR> }<BR> public void keyPressed(KeyEvent e) {<BR> adaptee.this_keyPressed(e);<BR> }</DIV>
<DIV>} //**********************************************<BR> public void update(Graphics screen) {<BR> paint(screen);<BR> }<BR>}<BR></DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam? Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com