Exemplo n.º 1
0
  /**
   * Constructor for the Player class.
   *
   * @param resources {@link ResourcesWrapper} - The resources that the player can use. creating a
   *     new instance is fine.
   * @param locX int - The x-coordinate where the player should spawn.
   * @param locY int - The y-coordinate where the player should spawn.
   * @param isFirstPlayer boolean - checks whether the player is number one or two.
   */
  public ConcretePlayer(ResourcesWrapper resources, int locX, int locY, boolean isFirstPlayer) {
    super(resources.getPlayerImageStill(), locX, locY);
    initialLocx = locX;
    initialLocy = locY;
    speed = REGULAR_SPEED;
    lives = 3;
    score = 0;
    money = 0;
    this.firstPlayer = isFirstPlayer;

    this.weapon = new RegularWeapon(new ResourcesWrapper(), 0, 0);
    this.weapon.activate(this);

    this.animationCurrent = null;
    this.animationLeft = resources.getPlayerWalkLeft();
    this.animationRight = resources.getPlayerWalkRight();
  }
Exemplo n.º 2
0
 /**
  * The constructor for this class. Generates a bubble of size 2, with a maxverticalspeed of 6.
  * Adds two bubbles of size 1 to the list of next bubbles; those will be spawned when this bubble
  * is hit.
  *
  * @param resources {@link ResourceWrapper} - A new resourceWrapper that this class can use.
  * @param locX : the starting x-location of the bubble.
  * @param locY : the starting y-location of the bubble.
  */
 public Bubble2(ResourcesWrapper resources, float locX, float locY) {
   super(resources.getBubbleImage2(), locX, locY, resources);
 }