Making my enemies drop bombs in space invaders

Hi all,
I'm in the process of learning flash just now and am
completing an online tutorial on Space Invaders. Thing is, the
bombs drop from a random location on the screen. I want them to
drop from a random enemy (I'm not too bothered just now about
making it one on the bottom row or one with no other enemies before
them).
At the moment, here is the AS that makes them drop (the
frequency is determined elsewhere):
eval("_root.alienBomb" + alienBombNum)._x =random(700);
eval("_root.alienBomb" + alienBombNum)._y =
300*Math.random();
An I can modify it to get a certain one to drop:
eval("_root.alienBomb" + alienBombNum)._x
=_root.alienClip2_2._x;
eval("_root.alienBomb" + alienBombNum)._y =
_root.alienClip2_2._y;
I can' t get it to randomly choose one - I know I have to use
the random function, but don't know how to implement this.
Can anyone help?
regards,
g

The code you're using is really old...back to Flash 5, I'd
guess, which makes this rather more complicated than it need be.
Since you seem to be in AS1, I'll keep it that way. Try
using:
xGridNum = Math.round(Math.random() * 7);
yGridNum = Math.round(Math.random() * 7);
var bomb = _root["alienBomb"+alienBombNum];
var alien = _root["alien"+xGridNum+"_"+yGridNum];
bomb._x = alien._x;
bomb._y = alien._y;
The above isn't the best way to do this, but it's simple and
not far from what you've referenced. The sevens above assume 8 rows
and 8 columns of aliens (numbered alien0_0 to alien7_7).
Hope that helps.

Similar Messages

  • Help with KeyDown (space invaders game)

    I'm making a space invaders type game for school using Greenfoot (new Java IDE). Whenever I press space, a bullet will fire. However, multiple bullets are being created when I press space once, and when I hold space, a long stream of bullets are being made. I want one bullet to be created when I press space. Tried using KeyPress, but apparently Greenfoot does not recognize java.awt? Thanks in advance.
    public class Ship extends Vehicle {
         * Constructor for objects of class Shuttle
        public Bullet B;
        boolean canFire = false;
        public Ship() {
            GreenfootImage ship = new GreenfootImage("spaceship.gif");
            this.setImage(ship);       
        //Create a bullet
        public void fire(){
            B = new Bullet();
            getWorld().addObject(B,getX(),getY()-60);
        public boolean collision(){
            Actor enemy = getOneIntersectingObject(null);
            return (enemy!=null) ? true : false;
        public void act(){
            // move with keys
            if (this.canMove())
                 move();      
            if(Greenfoot.isKeyDown("space")){               
                    fire();               
            else if(collision()){
                getWorld().removeObject(this);                           
    }

    Make a Class Variable to use as a flag indicating that a key was pressed... check to see if the flag is set, and if it is not, then fire a bullet and then set the flag. Reset the flag when they keyReleased action fires.
    This way only one bullet can be fired for each time a key is pressed, provided your act() is being polled, but if a keyPressed fires act(), but not a keyRelease too, then it will not work. If it does not work, then you'll need to go to a regular KeyListener.
    //Your code make these changes
    public class Ship extends Vehicle {
          * Constructor for objects of class Shuttle
         public Bullet B;
         boolean canFire = false;
         public Ship() {
             GreenfootImage ship = new GreenfootImage("spaceship.gif");
             this.setImage(ship);       
         //Create a bullet
         public void fire(){
             B = new Bullet();
             getWorld().addObject(B,getX(),getY()-60);
         public boolean collision(){
             Actor enemy = getOneIntersectingObject(null);
             return (enemy!=null) ? true : false;
         public void act(){
             // move with keys
             if (this.canMove())
                  move();      
            if(!GreenFoot.isKeyDown("space")) canFire = true; //add this
             if(Greenfoot.isKeyDown("space") and canFire){               
                     fire();              
                     canFire = false; //add this
             else if(collision()){
                 getWorld().removeObject(this);                           
    }

  • Space invaders! I need some help...!

    Hello,
    i'm trying to program a very simple version of space invaders. I'm drawing my moving objects (spaceship, rockets, aliens) with drawstring but I'm getting these compiling error: illegal start of expression.
    Also I want to move the spaceship with translate is this OK to do so!?
    Can somebody help me? Thanks for your help!
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Graphics2D;
    //in deze klasse teken ik het ruimteschip en kan het links/rechts bewegen
    public class Ruimteschip
         //ruimteschip
         Ruimteschip roderikschip = new Ruimteschip();
         public void paint(Graphics ruimteschip)
    {      //Ruimteschip weergeven
         Graphics2D ruimteschip2D = (Graphics2D)ruimteschip;
    String ruimteschip = "ruimteschip";
    ruimteschip2D.drawString("ruimteschip", x, y,);
         //beweegmethod
         public void beweegRechts()
         {     //teken opnieuw 1 coordinaat rechts
              roderikschip.translate(1, 0);
              ruimteschip2D.drawString("ruimteschip", x, y);
    //beweegmethod
         public void beweegLinks()
         {     //teken opnieuw 1 coordinaat links
              roderikschip.translate(-1, 0);
              ruimteschip2D.drawString("ruimteschip", x, y);
    }

    Hi and thanks for your replies.
    I know drawString isn't the most beautiful way, but I'm making this game for an assignment, and I have to use drawString.
    Still i'm getting "illegal start of expression" in my paint method...
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import java.awt.Graphics2D;
    //in deze klasse teken ik het ruimteschip en kan het links/rechts bewegen
    public class Ruimteschip
         //ruimteschip
            Ruimteschip ruimteschip = new Ruimteschip();
         public void paint(Graphics ruimteschip)
        {      //Ruimteschip weergeven
             Graphics2D ruimteschip2D = (Graphics2D)ruimteschip;
            String s = "ruimteschip";
            *ruimteschip2D.drawString(s, x, y,);*
         //beweegmethod
         public void beweegRechts()
         {     //teken opnieuw 1 coordinaat rechts
              s.translate(1, 0);
              ruimteschip.drawString(s, x, y);
        //beweegmethod
         public void beweegLinks()
         {     //teken opnieuw 1 coordinaat links
              s.translate(-1, 0);
              ruimteschip.drawString(s, x, y);
    } Edited by: Roddy on May 1, 2008 8:28 AM

  • How do i remove an Object (aliens/ bullets) from my Space Invaders game??

    Creating Space Invaders game and im getting confused on removing objects from my game. How do you actually remove an object (i.e bullets and aliens).
    I know this isnt the right way to do it, but for the bullets i had an array of the Objects bullets[] and set the x and y coordinates off screen so u cant see then wen they are painted you cant see them, then wen the player fires them, the x and y coordinates change so they come from the players ship till it hits an alien or goes off screen, then i reset the coordinates so they are pasted off screen again. Im relatively new to this so i would appreciate any help. Im going to have to do the same with aliens wen a collision is detected. Is there a way of actually removing an object?
    Here is sum code incase you need to see it:
    public void checkCollision()
              Rectangle playerRec = new Rectangle(player1.getBoundingBox());
              for(int i=0; i<alienRow; i++)
                   for(int j=0; j<alienCol; j++){
                        if(playerRec.intersects(aliens[i][j].getBoundingBox()))
                             collisionDetected();
                        for(int k=0; k<bulletNum; k++){
                             Rectangle bulletRec = new Rectangle(bullets[k].getBoundingBox());
                             if(bulletRec.intersects(aliens[i][j].getBoundingBox()))
                                  removeBullet(bullets[k]);
                                  collisionDetected();
         public static void collisionDetected()
              System.out.println("COLLISION");
    private void removeBullet(Bullets bullet){
              bullet.fired=false;
              bullet.setX(-10);
              bullet.setY(-10);
         }Edited by: deathwings on Nov 25, 2009 8:20 AM

    deathwings wrote:
    I was thinking bout that arraylist angle before, but it makes sense now so i think that will work ok. Thx kevin.Not a problem.
    Taking the List idea one step further, you could have a parent Object/Interface that all of your game objects extend/implement. Let's call it GameObject.
    A GameObject would have a draw(Graphics g) function that you call from your paintComponent( ) method, and for example an act( ) function as well.
    You'd have a single List of GameObjects that you add everything in your game into. Now painting is simply a matter of looping over a single List. And in your game logic loop, you could do a similar thing with the act( ) function: your bullet's act( ) would simply move it forward and check for collisions and going off screen. An alien's act( ) function would move it around and maybe shoot a weapon every so often.
    Just an idea.

  • Need Help with Java Space Invaders Game!

    Hi, im new to these forums so forgive if i dont follow the right way on laying things out. Im trying to create space invaders game but im stuck when im trying to create multiple aliens/ invaders. I have a class called Aliens (which is the invaders), and i can create an instance of an Alien. But when I try to create multiple instances they are not showing up on screen. I am not getting any error message though (which im hoping is a good sign, lol).
    GamePanel is where all the action is and Alien is the alien (invaders) class.
    Here is the code:
    import java.awt.; import javax.swing.; import java.awt.Image; import java.awt.event.KeyListener; import java.awt.event.KeyEvent;
    public class GamePanel extends JComponent implements KeyListener { SpaceInvaders game; static Player player1; Aliens alien1; static public Image spaceship2R; static public Image spaceship2L;
    public GamePanel(SpaceInvaders game)
         this.game = game;
         player1 = new Player(this);
         player1.start();
                   ///// trying to create multiple instances of aliens here
         for(int i=0; i<4; i++)
              alien1 = new Aliens(this);
              alien1.setX(i*100);
              alien1.start();
        this.setFocusable(true);
        this.addKeyListener(this);
    public void paintComponent(Graphics g)
         Image pic1 = player1.getImage();
         Image pic2 = alien1.getImage();
         super.paintComponent(g);
         g.drawImage(pic1, player1.getX(), player1.getY(), 50, 50,this);
         g.drawImage(pic2, alien1.getX(), alien1.getY(), 50, 50,this);
    }//end class
    import java.awt.Image; import java.awt.*;
    class Aliens extends Thread { //variables GamePanel parent; private boolean isRunning; private int xPos = 0, yPos = 0; Thread thread; static char direction = 'r'; Aliens alien; static public Image alien1; static public Image alien2;
    public Aliens(GamePanel parent)
         this.parent = parent;
         isRunning = true;
    public void run()
         while(isRunning)
              Toolkit kit = Toolkit.getDefaultToolkit();
              alien1 = kit.getImage("alien1.gif");
              alien2 = kit.getImage("alien2.gif");
              try
                      thread.sleep(100);
                 catch(InterruptedException e)
                      System.err.println(e);
                 updateAliens();
                 parent.repaint();
    public static Image getImage()
         Image alienImage = alien1;
        switch(direction){
             case('l'):
                  alienImage = alien1;
                  break;
             case('r'):
                  alienImage = alien1;
                  break;
        return alienImage;     
    public void updateAliens()
         if(direction=='r')
              xPos+=20;
              if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                   yPos+=50;
                   xPos-=20;
                   direction='l';
         else
              xPos-=20;
              if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                   yPos+=50;
                   xPos+=20;
                   direction='r';
    public void setDirection(char c){ direction = c; }
    public void setX(int x){ xPos = x; }
    public void setY(int y){ yPos = y; }
    public int getX(){ return xPos; }
    public int getY(){ return yPos; }
    }//end classEdited by: deathwings on Oct 19, 2009 9:47 AM
    Edited by: deathwings on Oct 19, 2009 9:53 AM

    Maybe the array I have created is not being used in the paint method, or Im working with 2 different objects as you put it? Sorry, Im just learning and I appreciate your time and help. Here is my GamePanel Class and my Aliens class:
    import java.awt.*;
    import javax.swing.*;
    import java.awt.Image;
    import java.awt.event.KeyListener;
    import java.awt.event.KeyEvent;
    import java.awt.image.BufferStrategy;
    public class GamePanel extends JComponent implements KeyListener
         SpaceInvaders game;
         static Player player1;
         static Bullets bullet;
         //static public Image spaceship2R;
         //static public Image spaceship2L;
         private BufferStrategy strategy;
         static int alienNum =0;
         static Aliens[] aliens;
         public GamePanel(SpaceInvaders game)
              this.game = game;
              player1 = new Player(this);
              player1.start();
              Aliens[] aliens = new Aliens[10];
              for(int i=0; i<4; i++)
                   aliens[i] = new Aliens(this);
                   aliens.setX(i*100);
                   aliens[i].start();
                   alienNum++;
              initialiseGame();
              this.setFocusable(true);
    this.addKeyListener(this);
         public void paintComponent(Graphics g)
              Image pic1 = player1.getImage();
              Image pic2 = aliens[0].getImage();
              Image bulletPic = bullet.getImage();
              super.paintComponent(g);
              g.drawImage(pic1, player1.getX(), player1.getY(), 50, 50,this);
              for ( int i = 0; i < alienNum; i++ )
                   g.drawImage(pic1, aliens[0].getX(), aliens[0].getY(), 50, 50,this);
              //if (bullet.fired==true){
              //     g.drawImage(bulletPic, bullet.getX(), bullet.getY(), 20, 20,this);
         public void keyPressed(KeyEvent k)
              switch (k.getKeyCode()) {
              case (KeyEvent.VK_KP_DOWN):
              case (KeyEvent.VK_DOWN):
                   player1.setDirection('d');
                   break;
              case (KeyEvent.VK_KP_UP):
              case (KeyEvent.VK_UP):
                   player1.setDirection('u');
              break;
              case (KeyEvent.VK_KP_RIGHT):
              case (KeyEvent.VK_RIGHT):
                   player1.setDirection('r');
              break;
              case (KeyEvent.VK_KP_LEFT):
              case (KeyEvent.VK_LEFT):
                   player1.setDirection('l');
              break;
              case (KeyEvent.VK_SPACE):
                   fireBullet();
              break;
         public void keyTyped(KeyEvent k) {}//empty
         public void keyReleased(KeyEvent k)
              player1.setDirection('n');
         public void initialiseGame()
         public static void checkCollision()
              Rectangle playerRec = new Rectangle(player1.getBoundingBox());
              for(int i=0; i<alienNum; i++)
                   //if(playerRec.intersects(aliens[i].getBoundingBox()))
                        //collisionDetected();
         public static void collisionDetected()
              System.out.println("COLLISION");
         public void fireBullet()
              Bullets bullet = new Bullets(player1.getX(),player1.getY());
              bullet.fired=true;
    }//end GamePanelimport java.awt.Image;
    import java.awt.*;
    class Aliens extends Thread
         //variables
         GamePanel parent;
         private boolean isRunning;
         private int xPos = 0, yPos = 0;
         Thread thread;
         static char direction = 'r';
         Aliens alien;
         static public Image alien1;
         static public Image alien2;
         public Aliens(GamePanel parent)
              this.parent = parent;
              isRunning = true;
         public void run()
              while(isRunning)
                   Toolkit kit = Toolkit.getDefaultToolkit();
                   alien1 = kit.getImage("alien1.gif");
                   //alien2 = kit.getImage("alien2.gif");
                   try
              thread.sleep(100);
         catch(InterruptedException e)
              System.err.println(e);
              updateAliens();
              parent.repaint();
         public static Image getImage()
              Image alienImage = alien1;
         switch(direction){
              case('l'):
                   alienImage = alien1;
                   break;
              case('r'):
                   alienImage = alien1;
                   break;
         return alienImage;     
         public void updateAliens()
              if(direction=='r')
                   xPos+=20;
                   if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                        yPos+=50;
                        xPos-=20;
                        direction='l';
              else
                   xPos-=20;
                   if(xPos >= SpaceInvaders.WIDTH-50||xPos < 0)
                        yPos+=50;
                        xPos+=20;
                        direction='r';
         public Rectangle getBoundingBox()
              return new Rectangle((int)xPos, (int)yPos, 50, 50);
         public void setDirection(char c){ direction = c; }
         public void setX(int x){ xPos = x; }
         public void setY(int y){ yPos = y; }
         public int getX(){ return xPos; }
         public int getY(){ return yPos; }
    }//end class                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Controlling fire in Space Invaders game

    Hi again,
    still working through the tutorial on Space Invaders in Flash
    MX 2004 (bit out of date, I know).
    I've got the player craft under mouse control. What I don't
    like about the game is that you can fire as rapidly as you wan't,
    though the number of bullets is limited. You can change this limit
    in the variable - I would rather have it though that you can only
    have a set number of bullets in play at a time (at the moment, if
    you go over the limit, the uppermost bullets just disapear).
    Here is the code:
    // when the mouse cliks
    onClipEvent(mouseDown)
    // duplicate the bullet mc
    _root.bullet.duplicateMovieClip("bullet"+bulletNum,bulletNum);
    // set the coords to the mouse clik
    eval("_root.bullet" + bulletNum)._x = this._x;
    eval("_root.bullet" + bulletNum)._y = this._y;
    // increment the bullet number
    bulletNum++;
    // if more than 50 bullets , start again at 0
    if(bulletNum>50)
    bulletNum = 0;
    What code could I use to have it so that you can only have,
    say, 3 bullets in play at once, and you can't fire again until
    they've hit / left the screen?
    regards,
    g

    Hi again,
    thanks for that. Another way would be to use code like the
    following:
    var enableInterval:Number;
    var allowFire:Boolean;
    function tempDisableFire():Void {
    allowFire = false;
    enableInterval = setInterval(enableFire, 500); // 500
    millisecond delay
    function enableFire():Void {
    allowFire = true;
    clearInterval(enableInterval);
    I am unsure though whether to insert this within my existing
    code, or to use this starting from scratch. If it was inside an
    onClipEvent tag (the event being the mouse click), I could then use
    it to control the fire. I'm not sure if I would do this with an "if
    / then" statement.
    Any suggestions on this method? I know it may be asking a bit
    much, but if you could even complete this piece of code that would
    be magic!
    cheers,
    g

  • Firing bullets in space invaders game

    hey guys,
    I am trying to work out the logic and the code required for firing a bullet in a space invaders style game.
    I have a space ship on a stage that moves around freely using the arrow keys and I want to use the space bar to release a bullet.
    So far my thinking is as follows:
    when the space bar is pressed a bullet is released from the players space ship.
    so I need to think about:
    - the speed of the bullet
    - the position of the spaceship when the bullet is fired
    - being able to fire multiple bullets one after the other
    - the bullet should move from the bottom of the screen to the top of the screen
    - the consequence of a bullet hitting a target
    I do not know how many scripts I would need to tackle this? how many behaviours per script and more importantly the code required....
    I am desperate for any help and support you can provide...
    thank you

    thank you for your support
    at this current time it would be a waste of time to understand how things work that did not benefit my game, sure knowledge would give me power but at the moment Id rather concentrate on gaining the appropriate knowledge as per the mechanics of my game and not going off in the opposite direction
    having had a look at your space invaders game and the code and logic you provided it is different to the game I am building because:
    - you use the move for movement and fire whereas I use cursor keys and a space bar
    - you have limited the amount of ammuntion, I have not
    - there are no explosions or changing of cast members on intersection.
    I understand the aim of you posting the guide however I am of the thinking it would be better to follow a tutorial that is in line with what I require rather then learning a particular style and then again having to work out how to amend it again to be used in my game...
    So if anyone can help me understand or provide code as per my initial message , I would be so grateful
    thank you

  • Dropping Rollback table space in export dump and use the undo table space

    Hi,
    I want to upgrade my DB which is on 9.2.0.1.0 to 10.2.0.1.
    I have done an export.
    In order to import the DB I have created all the table spaces identical that of my export copy. While creating the Blank database I have already created Undo table space. In the exported DB I have a table space called rollback, how can I drop this table space and use undo table space. I believe this is the recommended table space that should be used in new releases
    Thank you

    Very briefly, these are the steps you will need to perform:
    1) Create an UNDO tablespace the same size as the Rollback tablespace, e.g.:
    CREATE UNDO TABLESPACE undo
    DATAFILE ‘/ora/$ORACLE_SID/001/oradata/$ORACLE_SID/undo_01.dbf’ size 1000M;
    2) Add the initialisation parameters UNDO_MANAGEMENT=AUTO, UNDO_TABLESPACE=UNDO. Omit the UNDO_RETENTION parameter unless it is to be set to a value other then the default of 900 (seconds)
    3) Remove the initialisation parameter ROLLBACK_SEGMENTS
    4) Bounce the database to bring the new parameters into effect.
    5) Drop the Rollback tablespace including contents and datafiles
    Cheers,
    Jason

  • Help! trying to create 'space invaders'

    hi. im a high school student with a little knowledge of java. im am currently working on a class assignment where each student has to create their own program. i decided to create the classic game of 'Space Invaders'. But i have a problem; i can't figure out how i will get the characters to move.
    does anyone if there is a method that will allow the user to move a character? for example, in C++ there is a conio.h library that has a goto(x,y) function. is there one for java as well? thanks alot!

    This is another way
    import java.awt.*;
    import javax.swing.*;
    import java.awt.event.*;
    public class Si extends JFrame
         Timer  ta;
         myView view = new myView();
    public Si() 
         setBounds(3,10,765,350);
         addWindowListener(new WindowAdapter()
         {     public void windowClosing(WindowEvent ev)
              {     dispose();
                   System.exit(0);
         getContentPane().add("Center",view);
         setVisible(true);
         ta = new Timer(45, new ActionListener()
         {     public void actionPerformed(ActionEvent e)
                   view.move();
         ta.start();
    public class myView extends JComponent 
         Point invs[]   = new Point[15];
         Color invc[]   = new Color[15];
         Color  color[] = new Color[]{
                        Color.blue,   Color.cyan, Color.green, Color.magenta,
                    Color.orange, Color.pink, Color.red,   Color.yellow};
    public myView()
         for (int p=0; p < invs.length; p++)
              int x = (int)(Math.random()*600)+33;
              int y = (int)(Math.random()*200)+33;
              invs[p] = new Point(x,y);
              int c = (int)(Math.random()*8);
               invc[p] = color[c];
    public void move()
         for (int p=0; p < invs.length; p++)
              repaint(invs[p].x-1,invs[p].y-1,20,18);
              int x = (int)(Math.random()*3)-1;
              int y = (int)(Math.random()*3)-1;
              invs[p].translate(x,y);
              repaint(invs[p].x-1,invs[p].y-1,20,18);
    public void paintComponent(Graphics g)
         super.paintComponent(g);
         Graphics2D g2 = (Graphics2D)g;
         g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);          
         for (int p=0; p < invs.length; p++)
              g.setColor(invc[p]);
              g.fillOval(invs[p].x,invs[p].y,17,13);
    public static void main (String[] args) 
         new Si();
    }      Noah

  • [FLMX] ayuda con tutorial space invaders

    Hola a todos.
    estoy tratando de hacer una modificación de un FLA del
    space invaders
    que me bajé en:
    http://www.flashkit.com/movies/Games/Full_Game_Source/Space_In-Paul_Nea-8765/index.php
    Este jueguecillo incluye un PHP que guarda los records en
    unos txt.
    La cuestión es que no tengo mucha idea de
    programación y no me funcionan
    los records.
    ¿alguien podria ayudarme?
    gracias mil
    Juan

  • Space Invaders.

    Hi, could you please try my game Space Invaders, to see if you can find any bugs etc? Let me know...
    http://www.geocities.com/ajbasic/SpaceInvaders.html

    the ability to die should definitely be the last thing you code ;) It's so cool to play an early staged game without ever being able to die.
    OK, so my comments:
    The pictures, if you're going to allow them to overlap, as you do now, give them some transparency.
    Also, right now, the ships will go all the way to the bottom and through the bottom of the screen.... that's bad.
    Anything else I'd think would be immediately obvious. Keep going with it and I hope to see some origional twists that you come up with

  • Can't drag and drop files between spaces in lion osx

    since upgrading to lion osx, i've noticed that i can't drag a pic, for example, from safari and drop it into a chat box in ichat.  used to drag pics, web addresses, text, etc across spaces all the time in snow leopard but i don't seem to be able to do it in lion.  does anyone else have this problem or am i missing something?

    You have many issues with your and your wife's machine(s). Everything you've posted works here. Reinstall Snow Leopard, repair permissions, and see if that fixes things.

  • Drag and dropping files in spaces

    I used to be able to drag a file, let say out of "my documents" and drag it to the upper left hand corner of my desktop, where my spaces would show up, I could then drag it to another space and the screen would flash and jump to that space. When I do this now it does not work, I have restarted and still not working now for a couple of weeks. This was nice to take a mp3 file (for example) and drag it on my external drive which was in another space.
    Any answers on this one?? Please email me at [email protected]
    Thanks!

    It is, that is not the problem. The problem is once I drag a file to the upper left corner and then I see my 8 spaces, I cannot drag the file over the space I want to drop it in to. Before, when I would hover over the space I wanted to drop a file over to, it would make a quick flash and then open that space/window. Now it does not and this is what I want resolved.
    Thanks
    Casey

  • Compare time slot in dates while making drag and drop..

    Hi,
    The drag and drop is working fine without conditions, but I have to check the time slots between two dates. If the time of both date are same it should not dropped else it can drag and drop. I use the code below, but not getting executed according to condition.. Please provide suggestion and ideas to get it executed..
    declare
    l_date_value varchar2(150) := apex_application.g_x01;
    l_primary_key_value varchar2(150) := apex_application.g_x02;
    l_full_time varchar2(150);
    l_time_a varchar2(150);
    l_time_b varchar2(150);
    begin
    select
    ltrim(replace(to_char(resv_start_date,'hhmiAM'),'00',' '),'0')||','|| ltrim(replace(to_char(l_date_value ,'hhmiAM'),'00',' '),'0')
    into l_full_time
    from reservation
    where resv_no=l_primary_key_value;
    select SUBSTR(l_full_time, 1 ,INSTR(l_full_time, ',', 1, 1)-1) into l_time_a from dual;
    select SUBSTR(l_full_time, INSTR(l_full_time,',', 1, 1)+1)into l_time_b from dual;
    begin
    if l_time_a<> l_time_b then
    update reservation set RESV_START_DATE = to_date(l_date_value,'RRRRMMDDHH24MISS') where Resv_no= l_primary_key_value;
    end if;
    exception when others then
    Raise_application_error(-20001,'Error'||SQLERRM);
    end;
    end;
    Thanks..

    First 3 .as are the component
    source. in the last test.mxml file i have written the drag and drop functionality.
    can any help me?? please

  • Writing a Class for making the 'enemies' follow the 'player'...

    Greetings;
    I'm an actionscript beginner and trying  to write a class to  make the 'enemies' follow the 'player' (shown below). I'm trying to write it such that it takes two MovieClips as arguments, and moves the first one toward the second one. When I import the Class try to use it in Main.as by typing  " var followPlayer:FollowPlayer = new FollowPlayer(fishMov0, player);", I get the following error:
    "ArgumentError: Error #1063: Argument count mismatch on jab.enemy::FollowPlayer/followPlayer(). Expected 2, got 1."
    Any ideas/suggestions would be appreciated.
    Thanks,
    Jeremy
    package  jab.enemy
        import flash.display.MovieClip;
        import flash.events.Event;
        public class FollowPlayer
            private var _clip1:MovieClip
            private var _clip2:MovieClip
            private var speed:uint = 1.5;
            public function FollowPlayer(clip1:MovieClip, clip2:MovieClip): void
            // clip1 is the enemy, clip2 the player being followed.
                _clip1 = clip1;
                _clip2 = clip2;
                _clip1.stage.addEventListener(Event.ENTER_FRAME, followPlayer);
                _clip2.stage.addEventListener(Event.ENTER_FRAME, followPlayer);
            private function followPlayer(_clip1:MovieClip, _clip2:MovieClip)
                    if (_clip1.y > _clip2.y)
                        _clip1.y -= speed;
                    if (_clip1.y < _clip2.y)
                        _clip1.y += speed;
                    if (_clip1.x > _clip2.x)
                        _clip1.x -= speed;
                    if (_clip1.x > _clip2.x)
                        _clip1.x -= speed;

    Thanks guys! My code was seriously flawed, but I ended up getting it to work. For anyone else that might be interested, see 'FollowPlayer' below, an extremely simple class which takes two MovieClips as arguments, and moves the first one slowly (at 24fps) toward the second one:
    package  jab.enemy
        import flash.display.MovieClip;
        import flash.events.Event;
        public class FollowPlayer
            private var _clip1:MovieClip
            private var _clip2:MovieClip
            private var speed = 1 + Math.random();
            public function FollowPlayer(clip1:MovieClip, clip2:MovieClip): void
            // clip1 is the enemy, clip2 the player being followed.
                _clip1 = clip1;
                _clip2 = clip2;
                _clip1.stage.addEventListener(Event.ENTER_FRAME, onEnterFrame)
                function onEnterFrame(event:Event):void
                    if (_clip1.y > _clip2.y)
                        _clip1.y -= speed;
                    if (_clip1.y < _clip2.y)
                        _clip1.y += speed;
                    if (_clip1.x > _clip2.x)
                        _clip1.x -= speed;
                    if (_clip1.x < _clip2.x)
                        _clip1.x += speed;

Maybe you are looking for

  • Need Product Costing Interview Questions and Answers

    Hi SAP Gurus, I am looking for the product costing interview questions and answers or just questions which covers all the steps like 1. Product Cost planning, Cost Object controlling, WIP and settling in all the Scenarios (Make to Stock, Make to Orde

  • Queue Name

    Hi XI gives random queue names, for EO and EOIO queues. When is the queue name generated ? Is it when the message enters the SMQ2 of the XI ? Logically it should get a name there. Would it change when it reaches the SMQ1 ? The outbound queue to the r

  • Cant copy and paste text or move by paragraph in email compose window

    Hi, win8, heaps of memory, TB 24.6.0, various add-ons The copy and paste just stops functioning sometime - when I select ctrl+c then ctrl+v nothing happens. Also, ctrl+ left /right arrows will move by word, but up/down arrows do nothing. Both the cop

  • Error when applying patch 3171663(11.5.9 CU2 )..

    hi.. error when applying patch 3171663(11.5.9 CU2 ) below error in log file: Assigned: file mscplan.odf on worker 1 for product msc username MSC. Time is: Sat May 22 2010 21:58:03 FAILED: file mscplan.odf on worker 1 for product msc username MSC. Tim

  • Post to accounting document

    HI I am creating a sales order with credit card details, and then at the billing I am increasing the document value,in that case the accounting document is not getting cleared, Please can someone let me know if there is any user exit/BADI which may h