Android Open Source - Layrd Layrd Physics






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  w  w w.  ja  v a 2s  .  c om*/
import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;


public class LayrdPhysics {
  public static boolean overlapRectangles (Rectangle r1, Rectangle r2) {
    if (r1.x < r2.x + r2.width && r1.x + r1.width > r2.x && r1.y < r2.y + r2.height && r1.y + r1.height > r2.y)
      return true;
    else
      return false;
  }

  public static boolean pointInRectangle (Rectangle r, Vector2 p) {
    return r.x <= p.x && r.x + r.width >= p.x && r.y <= p.y && r.y + r.height >= p.y;
  }

  public static boolean pointInRectangle (Rectangle r, float x, float y) {
    return r.x <= x && r.x + r.width >= x && r.y <= y && r.y + r.height >= 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