Android Open Source - Layrd Game Object






From Project

Back to project page Layrd.

License

The source code is released under:

MIT License

If you think the Android project Layrd 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.Voltronics.game;
/*from  ww w.j av a  2 s  .  c o  m*/
import com.badlogic.gdx.graphics.g2d.Sprite;
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;

public class GameObject {

  public Vector2 oldPosition;
  public Vector2 position;
  public Rectangle rectBounds;
  public Vector2 velocity;
  public Sprite sprite;

  public GameObject (float x, float y, float width, float height) {
    this.oldPosition = new Vector2(x, y);
    this.position = new Vector2(x, y);
    this.rectBounds = new Rectangle(x - width / 2, y - height / 2, width, height);
    velocity = new Vector2();
    sprite = new Sprite();
  }


    public void setSize(float x, float y){
        rectBounds.setSize(x, y);
        sprite.setSize(x,y);
    }

}




Java Source Code List

com.Voltronics.game.GameObject.java
com.Voltronics.game.LayrdGame.java
com.Voltronics.game.LayrdGoogleGameInterface.java
com.Voltronics.game.LayrdGraphics.java
com.Voltronics.game.LayrdInput.java
com.Voltronics.game.LayrdLogic.java
com.Voltronics.game.LayrdPhysics.java
com.Voltronics.game.LayrdScreenGame.java
com.Voltronics.game.LayrdScreenMainMenu.java
com.Voltronics.game.LayrdSound.java
com.Voltronics.game.LayrdWorld.java
com.Voltronics.game.Player.java
com.Voltronics.game.TutorialScreen.java
com.Voltronics.game.android.AndroidLauncher.java
com.google.example.games.basegameutils.BaseGameActivity.java
com.google.example.games.basegameutils.GameHelperUtils.java
com.google.example.games.basegameutils.GameHelper.java