Android Open Source - catchanimals Element






From Project

Back to project page catchanimals.

License

The source code is released under:

GNU General Public License

If you think the Android project catchanimals listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ricardorb.sprites;
//  www  .j a  v  a  2 s .  c o  m
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import com.badlogic.gdx.math.Rectangle;
import com.ricardorb.catchanimals.CatchAnimals;

/**
 * Main class of every object drawed in the game
 * @author RicardoRB
 *
 */
public class Element extends Sprite {
  
  protected Rectangle rectangle;
  protected final CatchAnimals GAME;
  
  public Element(final Texture texture){
    super(texture);
    GAME = null;
    iniRectangle();
  }

  public Element(final Texture texture, final CatchAnimals game) {
    super(texture);
    this.GAME = game;
    iniRectangle();
  }
  
  public Element(final TextureRegion tRegion,final CatchAnimals game){
    super(tRegion);
    GAME = game;
    iniRectangle();
  }
  
  public void dispose(){
    getTexture().dispose();
  }
  
  public void update(){
    
  }

  public Rectangle getRectangle() {
    return rectangle;
  }

  public void setRectangle(Rectangle rectangle) {
    this.rectangle = rectangle;
  }
  
  private void iniRectangle() {
    rectangle = new Rectangle();
    rectangle.height = getHeight();
    rectangle.width = getWidth();
    rectangle.x = getX();
    rectangle.y = getY();
  }

}




Java Source Code List

com.ricardorb.catchanimals.Assets.java
com.ricardorb.catchanimals.CatchAnimals.java
com.ricardorb.catchanimals.android.AndroidLauncher.java
com.ricardorb.catchanimals.desktop.DesktopLauncher.java
com.ricardorb.controllers.ControllerBasket.java
com.ricardorb.controllers.ControllerOption.java
com.ricardorb.inputs.InputBasket.java
com.ricardorb.screens.GameScreen.java
com.ricardorb.screens.MainMenuScreen.java
com.ricardorb.screens.OptionScreen.java
com.ricardorb.sprites.Animal.java
com.ricardorb.sprites.Basket.java
com.ricardorb.sprites.Element.java