Game question #2

First of all, thanks for answering the last question I had. I was hoping someone could also give me some ideas for this food/market system. I know how to make an invisible button but how do I command it to switch frames to the market and then back to the game? I was also wondering how to make the rest of the functions in this game act accordingly. Such as the food depleting and in turn lowering the health, and fluctuating market prices and so on. If you could help by explaining things or suggesting some lessons that would be a great help to me!

function(){return A.apply(null,[this].concat($A(arguments)))}
                                                                    Such as the food depleting and in turn lowering the health, and fluctuating market prices and so on.
You can make your movieclips a variable and then change your food number which might represent something in graphic form. To change prices, use a random number, but make it limited to lets say "5-15" currency. Create a range

Similar Messages

  • Pc games question

    Hey all,
    I'm sure this is a question asked all the time, so please bear with me
    I'm really desiring to invest in a mac of some sort this summer, the only downside to mac at the moment, is that if you like to play games, the far majority are based for PC. Is there some way around through an emulator perhaps to be able to play such games on a mac?
    If yes, is it also possible to network a Mac into a LAN with PCs and play with/against those people on PCs?
    I did a few searches and I found a few devices out, or coming out that seem to suggest that a special network card is needed, but, if anyone knows the details - it would be greatly appreciated.
    Thanks alot.
    -Adam

    Hey all,
    I'm sure this is a question asked all the time, so
    please bear with me
    I'm really desiring to invest in a mac of some sort
    this summer, the only downside to mac at the moment,
    is that if you like to play games, the far majority
    are based for PC. Is there some way around through an
    emulator perhaps to be able to play such games on a
    mac?
    Just install Windows on your Mac via Bootcamp and run the games in Windows.
    If yes, is it also possible to network a Mac into a
    LAN with PCs and play with/against those people on
    PCs?
    I did a few searches and I found a few devices out,
    or coming out that seem to suggest that a special
    network card is needed, but, if anyone knows the
    details - it would be greatly appreciated.
    Macs use the same ethernet cards that PCs do.

  • Classic Video Games Question

    Hi all,
    I'm a bit of a video game lover and recently have come across some oldies on the web I used to love. Mostly PC games like Indiana Jones adventure types....
    I'm now 100% Mac, and found a copy on Amazon of one of these games on CD for sale. Question is, will very old mac based games run on my Intel Based iMac?
    If not, does any one know/has heard of any programs or tools to run video games classics?
    thanks

    Hi djkhont,
    As someone who was recently trying to revive my old PC games, try the following utilities:
    DosBOX - An MS-DOS emulator, available free for download for many platforms (including Mac OS X Universal)
    ScummVM - Another free application to run a good chunk of the classic LucasArts games (Monkey Island, Sam & Max, Loom, etc). You mentioned Indiana Jones... don't know which Indiana Jones you found at Amazon, but check the list of supported games, I believe "Last Crusade" is in there.
    As far as playing MacOS 9 (Classic) games on an Intel Mac, I'm afraid it's not possible, as the other posters had mentioned. The Intel Macs do not support the Classic environment.
    (another reason why I will never part with my old iBook...)
    Hope this helps,
    Steve
    iMac Intel Core 2 Duo, 2.16 GHz, 2 GB RAM   Mac OS X (10.4.9)   iBook G3 366 MHz (graphite clamshell), 576 MB RAM, Mac OS X 10.3.9

  • IPod Games Questions

    I purchased iPod games on my work Mac, Subsequently I had problems where the game refused to play on my iPod and asked me to resync. Unfortunately I was at home and the game is on my work Mac.
    My question is: Is there a way to put this game on to my home Mac so if I need to re-sync at home I can?

    Yes... you should be able to copy your purchased game files to another computer. Assuming I've read your message correctly you've restored your iPod and are now syncing with your iTunes library at home instead of work as previously. It should be possible to manually add the game while at work and then use Jeff's method from the previous post to recover the game to your home computer. If that is not possible there is another way...
    iPod games are stored in the iPod Games subfolder of your iTunes folder (I'm working on a PC here but should hold true for Macs). Copy the ipg file for the game and any associated folder onto some form of transportable media - e.g. the iPod in disk access mode. When you get home drag the file (and optional folder) to the iPod Games subfolder, start iTunes. Drag & drop the ipg file onto the iPod Games section of the library. This should import the game. Open the game's information page in the libray. At this point iTunes should ask you to confirm your account details so that it can authorise your computer to access this game file. It should now be possible to sync the game to your iPod.
    tt2

  • Some Mac OS X game questions

    I'm trying to create a game for Mac OS X. I want to be able to create a program where you are a spaceship, and you manuever your way through space, and I'll add other features to that, once I have the basics down. I have the following questions.
    1. How do I draw an NSImage in a view? I don't want to use an NSImageView, because I want the image to be able to move around.
    2. What would be the best way to start desinging my game? I haven't even started?
    I might come up with more questions later on. I am really stuck here. I have no idea where to begin.

    I found this method:
    - (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(CGFloat)delta
    I tried this out, but I don't know what NSCompositingOperation I want to use, I don't really understand them, even after looking at the documentation. What would be the best one to use to just make an NSImage appear in a view?

  • [Game]Question[Mutliplayer]

    So I'm working on a multiplayer networked game. So basically you log in with a username and password from the client's log-in GUI. The server checks it against a MySQL DB, and if the credentials are valid, you are logged into the game. The game is mostly that you control this white box with the arrow keys, and you click to shoot. And when two people are logged in, they can move around, dodging the other's bullets, while shooting in return.
    Questions
    How would I update the locations of the players on the screen? Should I just send a data string with the new coordinates of the player to the server, and the server updates it? Will there be lag in doing this method? Are there more efficient ways? If so, what?
    The timing and efficiency of this update is important as this is a time-crucial game.

    user13543633 wrote:
    So I'm working on a multiplayer networked game. So basically you log in with a username and password from the client's log-in GUI. The server checks it against a MySQL DB, and if the credentials are valid, you are logged into the game. The game is mostly that you control this white box with the arrow keys, and you click to shoot. And when two people are logged in, they can move around, dodging the other's bullets, while shooting in return.
    Questions
    How would I update the locations of the players on the screen? Should I just send a data string with the new coordinates of the player to the server, and the server updates it? There are a couple potential questions there, and I'm not sure which one you're asking.
    "What should the format of my messages be? That is, what should my message protocol look like?"Sending the new coordinates is a reasonable option, and probably the simplest. I would start with that. As for "data string," presumably you'll want to sent the coordinates in their native primitive format, which I suspect is int, rather than as Strings.
    "Should I send the data to the server, and let pass it on to the other client? Or should I send it directly to the other client?"Unless your game will always be played on a LAN, you'll probably have no choice but to have the clients communicate through the server.
    Will there be lag in doing this method? Of course there will. There's a lag in every single operation we do. Quantum action at a distance computers do not yet exist. There is nothing we can do in zero time.
    Are there more efficient ways? That question is meaningless at this stage.

  • Firmware + Games Question

    I was wondering if there was a way to get around the firmware update (1.2) so I can put my games I've bought on my iPod. My iPod gets disconnected when iTunes tries to update my iPod firmware.

    Hi Xb0x3r!
    The 1.2 Firmware update is required for games to be compatible with your Fifth Generation iPod. (no way around it if you want to play games).
    My iPod gets disconnected when iTunes tries to update my iPod firmware.
    Okay, now let's start the troubleshooting.
    First of all, check this possibility:
    1 - Connect your iPod.
    2 - In iTunes, click on your iPod in the left-panel.
    3 - Now, click on the "Music" tab in the upper panel of the right-area of iTunes.
    4 - See if "Enable Disk Use" is check-marked (if you're on "automatic sync" option). If Disk Use isn't enabled, then be sure to check-mark it now, eject your iPod, disconnect it, then reconnect it.
    5 - Now, try updating your iPod again with 1.2 firmware.
    Now here's some questions:
    1. Does your iPod seem to automtically disconnect from your computer just after having a little bit of time of being connected to your computer, or does this "automatic-ejecting" happen only when you start the firmware updating?
    2. Are you getting any error messages when connecting your iPod, or when trying to update your iPod with the latest version?
    3. By any chance do you run the McAffe Disk Scanner, or McAffe firewall/security program? If so, then go to the program, and turn off your internet security and firewall.
    -Kylene
    If any post helps or solves your issue, please mark it that way accordingly. Thank you for helping the boards!

  • ApplicationStorageDirectory - Best Practice for Games Question

    So I've been working on a game which uses AIR. My problem is that I have been storing my game assets in the application directory. That would be fine except that the game has a built-in editor which requires the ability to write files. Adobe has since locked the ApplicationDirectory to write access, so now I'm not sure of where I'm expected to store all of my user editable game files - which is potentially ALL game assets.
    The seemingly obvious choice is to use ApplicationStorageDirectory. While not ideal, in that it seems I would need to duplicate all assets from inside the application to the storage directory on startup, it would provide a standard and easy to find place to store editable game assets.
    However, this article (on this site) clearly tells me that I should not do that. It makes a good point. Backing up all of the games assets is messy proposition. And while I can see users who take advantage of the editting capabilities as appreciating the backup, for the average player, that would be a pretty big annoyance.
    So what am I expected to do in this scenario? I need a writable location where the user and the application can easily access all game assets ( XML, Image, MP3 ). I don't want to pick an arbitrary location, and I'm turned off by the application needing to redundantly house the data just to copy to the destination directory since there's no way for me to delete it once it's copied since I can't write to the application folder.
    Thanks for the thoughts.

    Hi,
    A couple things come to mind. It's actually not Adobe that locks the application directory on Windows, that's a MS permissions thing with folders under Program Files.  But either way, it's still a problem. 
    As you mentioned, you could copy files on first launch but depending on the size, this could be annoying after a user just sat through the install.  It's also not very friendly when you want to uninstall.  You might want to consider sub launching the AIR installer from a separate installer which also takes care of installing the game resources to another writable location.  Maybe this is user selectable, but at least it's monitored by the installer which should allow you to uninstall properly.
    Would it be possible to keep the resources with your app, but architect the editor such that only user created content would go in a user writable directory (such as a subdirectory off of their documents folder?)
    Chris

  • Movie & Game question

    I have the 60G iPod (the one that was out before the newest 80G). That was a 5th gen iPod right?
    So can I play the new games on it? What about the new movies?
    Thanks!

    yes and yes
    no search tho... yet

  • Virtual Game question ....can't seem to play on macbook pro

    I can't seem to play a virtual game on my laptop, I got this laptop for my college. This virtual world game runs fine on my parents iMac and the iMac was a late 2009 24" 2.66 Ghz Intel Core 2 Duo. 4GB 1067 MHz DDR3. My laptop specs are:
    15.4 Macbook Pro 2010
    Intel Core i5
    4GB Memory
    320GB hard drive1
    SD card slot
    Built-in battery (8-9 hour)b
    Intel HD Graphics
    NVIDIA GeForce GT 330M with 256MB
    And the game requirements is:
    Download for Mac OS X
    vSide Mac OS X Client
    What to do:
    System Requirements:
    Mac running OS X 10.4.10 or newer with 512MB RAM (1GB recommended)
    and a video card with 128MB VRAM or more.
    So can anyone tell me what's going on there? Thanks.

    My hard drive has 1.97gb, *I have 2.56gb* left.
    I think those numbers are wrong ? but if correct this cause be a serious performance issue, a hard drive needs at least 10% free space left on it for normal function ... are you sure you're not reading the RAM figures ? Open a Finder window and at the bottom will be 'xxxGB Available'
    SSD are very fast and quiet but they are expensive and offer lower capacity than normal internal drives. You can upgrade what you have to 500GB or if the right model/space to 650GB. If your drive is getting full I suggest you look at something like the Seagate 500GB 7200rpm kit from OWC for only $148

  • Tile Based Game Questions

    Hi, I know there are tons on posts about this topic, but I can not find the answer to my questions.
    First, how would I go about moving the world around so the char is always in the center or near center of the screen? Do I have to have some sort of offset or something?
    Second, how would I have efficient collision dection? I use the following code for movement...
    public class worldTravelPanel extends JPanel implements MouseListener
         mapGround mapGround = new mapGround();
         mapWall mapWall = new mapWall();
         mapRoof mapRoof = new mapRoof();
         mapDoor mapDoor = new mapDoor();
         mapNPC mapNPC = new mapNPC();
         Point2D start, end;
         double x, y, animationSet;
         Timer timer = new Timer();
         public worldTravelPanel()
              mapGround.loadImages("town");
              mapGround.loadTiles("olatheMap");
              mapWall.loadImages("town");
              mapWall.loadTiles("olatheMap");
              mapDoor.loadImages("town");
              mapDoor.loadTiles("olatheMap");
              mapNPC.loadImages("generic");
              mapNPC.loadTiles("olatheMap");
              mapRoof.loadImages("town");
              mapRoof.loadTiles("olatheMap");
              x = programWidth / 2;
              y = programHeight / 2;
              animationSet = 7.0;
         class moveTask extends TimerTask
              Point2D start = new Point2D.Double(hero.location[0][0], hero.location[0][1]);;
              Point2D end = new Point2D.Double(hero.location[1][0], hero.location[1][1]);
              double distance = start.distance(end);
              public void run()
                   if(((Math.abs(start.getX() - end.getX()) < 0.5) && (Math.abs(start.getY() - end.getY()) < 0.5)) && start != end)
                        start = end;
                   else if (start != end)
                        double distance = start.distance(end);
                        x = (end.getX() - start.getX()) / distance;
                        y = (end.getY() - start.getY()) / distance;
                        hero.location[1][0] = (int)(start.getX() + x);
                        hero.location[1][1] = (int)(start.getY() + y);
                        checkForCollision();
                        repaint();
                   else
                        hero.location[0][0] = (int)start.getX();
                        hero.location[0][1] = (int)start.getY();
                        timer.cancel();
              public void checkForCollision()
                   int tempX = (int)(hero.location[1][0] / 32);
                   int tempY = (int)(hero.location[1][1] / 32);
                   boolean wallCollision = false;
                        if(end.getX() > start.getX())
                        if(mapWall.currentWallMap[tempY][tempX + 1] != 00)
                             wallCollision = true;
                   else if(end.getX() < start.getX())
                        if(tempX <= 1)
                             tempX = 1;
                        if(mapWall.currentWallMap[tempY][tempX - 1] != 00)
                        wallCollision = true;
                   if(end.getY() < start.getY())
                        if(mapWall.currentWallMap[tempY + 1][tempX] != 00)
                        wallCollision = true;
                   else if(end.getY() > start.getY())
                        if(tempY <= 1)
                             tempY = 1;
                        if(mapWall.currentWallMap[tempY - 1][tempX] != 00)
                        wallCollision = true;
                   if(wallCollision == true)
                        System.out.println("Wall Collision: " + tempY + ", " + tempX);
                        //end.setLocation(hero.location[1][0], hero.location[1][1]);
                        //start.setLocation(hero.location[1][0], hero.location[1][1]);
                        start.setLocation(start.getX() + x, start.getY() + y);
                        x = start.getX();
                        y = start.getY();
                   else if(mapDoor.currentDoorMap[tempY][tempX] != 00)
                        System.out.println("Enter Door: " + mapDoor.currentDoorMap[tempY][tempX]);
                        hero.map = "olatheMap";
                        changeMap();
                   else if(mapNPC.currentNPCMap[tempY][tempX] != 00)
                        System.out.println("NPC Collision");
                        start.setLocation(start.getX() + x, start.getY() + y);
                        x = start.getX();
                        y = start.getY();
                   else
                        start.setLocation(start.getX() + x, start.getY() + y);
                        x = start.getX();
                        y = start.getY();
                   public void changeMap()
                   mapGround.loadTiles(hero.map);
                   mapWall.loadTiles(hero.map);
                   mapDoor.loadTiles(hero.map);
                   mapNPC.loadTiles(hero.map);
                   mapRoof.loadTiles(hero.map);
                   x = programWidth / 2;
                   y = programHeight / 2;
                   start.setLocation(x, y);
                   end.setLocation(x, y);
         protected void paintComponent(Graphics g)
              g.clipRect(0, 0, programWidth, programHeight);
              g.setColor(Color.white);
              g.fillRect(0, 0, programWidth, programHeight);
              mapGround.drawGround(g);//Floor Layer
              mapWall.drawWall(g);//Wall Layer
              mapDoor.drawDoor(g);//Interaction Layer 1
              mapNPC.drawNPC(g);//Interaction Layer 2
              charHero[(int)animationSet].paintIcon(this, g, (int)x, (int)y);
              mapRoof.drawRoof(g);//Roof Layer
         //Begin Mouse Listener Block
         public void mouseClicked(MouseEvent e){}
         public void mousePressed(MouseEvent e){processMouseMotion(e);}
         public void mouseReleased(MouseEvent e){}
         public void mouseEntered(MouseEvent e){}
         public void mouseExited(MouseEvent e){}
         private void processMouseMotion(MouseEvent e)
              if(e.getModifiers() == MouseEvent.BUTTON1_MASK)
                   hero.location[0][0] = (int)x;
                   hero.location[0][1] = (int)y;
                   hero.location[1][0] = (int)(e.getX() / 32) * 32 + 3;//Centers hero is tile
                   hero.location[1][1] = (int)(e.getY() / 32) * 32;//Centers hero is tile
                   timer.cancel();
                   timer = new Timer();
                   timer.schedule(new moveTask(), 0, 10);
         //End Mouse Listener Block
    }Thanks for any and all help!
    Ryltar

    I answered this here:
    http://forum.java.sun.com/thread.jsp?forum=406&thread=535480&tstart=60&trange=15
    If that doesn't work for you, ask some more specific questions and I'll try to give more help.

  • Volume during Games Question...

    I would have posted in the Audio/Sound section, but it seems spammed or something. Anyway, I can't change volume during some games (Jade Empire, ES5 Skyrim, etc.), but others I can... Is there an override for this or a work around? Please help if possible and thanks 
    Computer is Qosmio X870-BT3G23 with Win 8 64bit
    Qosmio X870-BT3G23

    Its the system volume I am unable to change during some games, other games I am able to change system volume while in game.
    Qosmio X870-BT3G23

  • Applet game question , plz take a look

    Hi!
    Which is the most common method when u have an applet game and you want to paint/print things on the screen, do i use the normal paint method?
    like this:
    public void paint(Graphics g) {
    g.drawImage(stone,0,0);
    g.drawImage(grass,0,44);
    //etc etc...
    } I don't know any other way so please tell me which is the most common way. And which alternatives there are.
    Thanks in advance. http://www.pbhome.se/alltomallt/html/Little%20Quester.html
    By the way, here is one game i made using the way i showed aboveEdited by: javaguy387 on Nov 20, 2007 8:19 AM
    Edited by: javaguy387 on Nov 20, 2007 8:27 AM
    Edited by: javaguy387 on Nov 20, 2007 8:28 AM

    Active rendering is when you actively decide when to render (draw) things.
    No, I don't have any current samples, and if I gave them to you it'd be because I used the wonderful "Search Forums" box on the left sidebar, or google. I suggest you learn to do the same or you won't get very far. Good luck with your work.

  • Game question - ArrayIndexOutOfBoundsExecption

    hello. I am trying to finish a game as a final project for my java II class. My problem is that in my Enemy class, I keep getting an ArrayIndexOutOfBoundsExecption, and I don't know why this is happening. Also, when I try to use setVisible to set the "enemy" JLabel (which contains an ImageIcon) to false, nothing happens. I get no compiler error about it but it just doesn't work.
    The ArrayIndexOutOfBoundsException always occurs while I'm running the program. It always happens as soon as an enemy is hit by a bullet. If anybody could help me figure out how to fix this error it would be greatly appreciated. Here is all of my code:
    //steven cahail
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class Enemy
         private int x, y, currentImage;
         private ImageIcon enemyIcon = new ImageIcon ("enemy.gif");
         private ImageIcon xplosion1 = new ImageIcon ("Explosion_1.gif");
         private ImageIcon xplosion2 = new ImageIcon ("Explosion_2.gif");
         private ImageIcon xplosion3 = new ImageIcon ("Explosion_3.gif");
         private ImageIcon xplosion4 = new ImageIcon ("Explosion_4.gif");
         private JLabel enemy = new JLabel (enemyIcon);
         private JLabel explosion1 = new JLabel (xplosion1);
         private JLabel explosion2 = new JLabel (xplosion2);
         private JLabel explosion3 = new JLabel (xplosion3);
         private JLabel explosion4 = new JLabel (xplosion4);
         Point enemyLocation;
         Timer deathKlok = new Timer (50, new DeathListener());
         Timer moveEnemy = new Timer (300, new MovementListener());
         JLabel[] enemyArray = new JLabel[4];
         public Enemy (int x1, int y1)
              x = x1;
              y = y1;
              currentImage = 0;
              enemyArray[0] = explosion1;
              enemyArray[1] = explosion2;
              enemyArray[2] = explosion3;
              enemyArray[3] = explosion4;
              enemyLocation = new Point (x, y);
              moveEnemy.start(); 
         public Point getLocation ()
              return enemyLocation;
         public int incX ()
              return enemyLocation.x += 5;
         public int incY ()
              return enemyLocation.y += 5;
         public Icon getEnemy()
              return enemy.getIcon();
         private class MovementListener implements ActionListener
              public void actionPerformed (ActionEvent event)
                   enemyLocation.y += 5;
         private class DeathListener implements ActionListener
              public void actionPerformed (ActionEvent event)
                        currentImage++;
                        enemy = enemyArray[currentImage];
                        deathKlok.stop(); //this has no effect on the ArrayIndexOutOfBoundsException
                        moveEnemy.stop();
                        enemy.setVisible(false);//should take the last image of the explosion off the screen
         public void destroy()
              deathKlok.start();
    //steven cahail
    //Spaceship (main panel class for final project)
    //this should be the ONLY panel class
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.util.ArrayList;
    public class Spaceship extends JPanel
         private int x, y, moveX, bulletX, bulletY, distance;
         private ImageIcon spaceship;
         ImageIcon bulletIcon = new ImageIcon ("bullet.gif");
         JLabel bullet = new JLabel (bulletIcon);
         Timer bulletTimer = new Timer (15, new BulletListener());
         ArrayList bulletArray,  pointList, tempBullet, drawPoints;
         private Point drawBullet;
         Enemy[] enemies = new Enemy[8];
         public Spaceship ()
              x = 350;
              y = 625;
              spaceship = new ImageIcon ("Spaceship.gif");
              moveX = 10;
              bulletY = y;
              setBackground (Color.black);
              setFocusable (true);
              setPreferredSize (new Dimension (800, 700));
              addKeyListener (new SpaceshipListener());
              bulletTimer.start();
              pointList = new ArrayList();
              drawPoints = new ArrayList();
              int[] enemyXs = {100, 300, 500, 700, 100, 300, 500, 700};
              int[] enemyYs = {200, 200, 200, 200, 300, 300, 300, 300};
              for (int index = 0; index < enemies.length; index++)
                   enemies[index] = new Enemy (enemyXs[index], enemyYs[index]);
         private class SpaceshipListener implements KeyListener
              public void keyPressed (KeyEvent event)
                   switch (event.getKeyCode())
                        case KeyEvent.VK_LEFT:
                             x -= moveX;
                             break;
                        case KeyEvent.VK_RIGHT:
                             x += moveX;
                             break;
                        case KeyEvent.VK_SPACE:
                             bulletArray = new ArrayList();
                             for (int index = bulletY; index > 0; index -= 3)
                                   bulletArray.add (new Point (x, index));                                                                    
                             pointList.add (bulletArray);
                             break;
                   repaint();
              public void keyTyped (KeyEvent event) {}
              public void keyReleased (KeyEvent event) {}
         private class BulletListener implements ActionListener
              public void actionPerformed (ActionEvent event)
                   if (!pointList.isEmpty())
                        for (int index = 0; index < pointList.size(); index++)
                           tempBullet = (ArrayList)(pointList.get (index));
                             if (!tempBullet.isEmpty())
                                  drawPoints.add (tempBullet.get (0));
                                  tempBullet.remove (0);
                   repaint();     
         public int getDistance (Point bullet, Point enemy)
              int discriminant;
              discriminant = (int)(Math.pow (bullet.x - enemy.getLocation().x, 2) + Math.pow(bullet.y - enemy.getLocation().y, 2));
              distance = (int)Math.sqrt (discriminant);
              return distance;
         public void paintComponent (Graphics page)
              super.paintComponent (page);
              spaceship.paintIcon (this, page, x, y);
              for (int index = 0; index < enemies.length; index++)
                   enemies[index].getEnemy().paintIcon (this, page, enemies[index].getLocation().x, enemies[index].getLocation().y);
              if (!drawPoints.isEmpty())
                   for (int index = 0; index < drawPoints.size(); index++)
                        drawBullet = (Point) (drawPoints.get (index)); 
                        //use drawBullet to compare distance from enemy.
                        bullet.getIcon().paintIcon (this, page, drawBullet.x + (bullet.getIcon().getIconWidth()/2), drawBullet.y);
                        drawPoints.remove (index); 
                        for (int idx = 0; idx < enemies.length; idx++)
                             if ((this.getDistance (drawBullet, enemies[idx].getLocation())) < 30)
                                  enemies[idx].destroy();
                                  //bullet.setVisible(false);
                                  //bulletTimer.stop(); //-same with this. it could prevent more bullets from being fired.
    } //steven cahail
    //driver class
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class SpaceshipTest
         public static void main (String[] args)
              JFrame frame = new JFrame ("Spaceship Test");
              frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
              frame.getContentPane().add (new Spaceship());
              frame.pack();
              frame.setVisible(true);
    }

    public void actionPerformed (ActionEvent event) {
        currentImage++;
        enemy = enemyArray[currentImage];Wild guess: do you ever reset currentImage back to zero? If not everytime an action occurs it continually increases until it reaches 4 and then you get AIOOBE since array has valid indicies of 0 - 3.

  • Ipod Nano game question

    Does anyone know what format the games on the nano are(if that's even possible to know??
    if you do please tell me.
    thanks

    Is there any way of like converting or make(if i have to) games into this format?? or is it just impossible at this time?

Maybe you are looking for

  • How do I share my itunes library with different devices

    I am trying to share my main computers itunes library so it can be accessed by multiple people on their own iphones. It will show up on my own iphone, but my roommates iphones it will not show up. Id like to be able to play music on my iphone from my

  • PDF WITH FRAME FIXED

    how to create a frame fixed outer pdf document within which scroll through the pages of the catalog? I would like to insert the buttons in the windows. So I must not insert the buttons in all the page and reading is better. I use Indesign CC.

  • IPad Air iOS 8.2

    i'm forgot my pass code how to unlock my iPad Air iOS 8.2 when i connect to iTunes i got a message turn find my iPad off first !!!

  • JAX-RPC Web services client error

    Hi! I use Jdevelop 10g 9.0.5.2 with JAX-RPC extension and OC4J 10.1.3. I can develop RPC/literal and document/literal Web services, but when I try to run a client program I've got this error. "Error: cannot access class oracle.j2ee.ws.saaj.soap.Const

  • Lumia 620 free shell offer

    Hi, Just been to http://nokia620freeshell.com to claim my free shell and the site says: "Fill in the form below, including your preferred colour choices and register your purchase to get a phone cover." Well there is no option to select my preferred