Package com.randarlabs.java.MarioAsteroids.object

Examples of com.randarlabs.java.MarioAsteroids.object.Sprite


    bg = new ImageIcon("res\\mario_pokemon.jpeg").getImage();
    marioIcon = new ImageIcon("res\\Smb1_mario.png").getImage();
    hammerIcon = new ImageIcon("res\\33px-Smb1_hammer.png").getImage();
    fireballIcon = new ImageIcon("res\\Smb1_bowser_flamef.png").getImage();
   
    mario = new Sprite(w, g);
    mario.setImage(marioIcon);
    marioPoint.setX(w.getSize().width / 2 - mario.center().X());
    marioPoint.setY(w.getSize().height / 2 - mario.center().Y());
    mario.setPosition(marioPoint);
    mario.setAlive(true);
   
   
    for(int n = 0; n < FIREBALLS; n++) {
      fireball[n] = new Sprite(w, g);
      fireball[n].setImage(fireballIcon);
      fireballPoint[n] = new MyPoint2D(0, 0);
      fireballVel[n] = new MyPoint2D(0.3, 0.3);
      fireball[n].setPosition(fireballPoint[n]);
      fireball[n].setAlive(false);
    }
   
    for(int n = 0; n < ENEMIES; n++) {
      hammer[n] = new Sprite(w, g);
      hammer[n].setImage(hammerIcon);
      hammer[n].setRotationRate(rand.nextInt(5) + 1);
      hammerPoint[n] = new MyPoint2D((double)rand.nextInt(w.getSize().width) - 20, (double)rand.nextInt(w.getSize().height) - 20);
      hammer[n].setPosition(hammerPoint[n]);
      hammer[n].setMoveAngle(rand.nextInt(360));
View Full Code Here


  }
 
 
 
  public Mario(Window w, Graphics2D g) {
    mario = new Sprite(w, g);
    mario.setImage(marioIcon);
    mario.setAlive(true);
  }
View Full Code Here

TOP

Related Classes of com.randarlabs.java.MarioAsteroids.object.Sprite

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.