Android Open Source - RockFall-Android Entity






From Project

Back to project page RockFall-Android.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project RockFall-Android 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 eu.raffprta.rockfall.core.entity;
/*from   w  w w .  ja v  a  2  s. co  m*/
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Rect;

import eu.raffprta.rockfall.app.SpriteContainer;

/**
 * Interface to specify all common Entity methods. An Abstract class will be provided
 * to implement the actual programming code in common, as well as to specify a
 * constructor set.
 */
public interface Entity extends SpriteContainer {

    /**
     * This method updates the Entity's position with x/y coordinates and respective velocities.
     */
    public void update(int x, int y, int velX, int velY);

    /**
     * Defines a method for retrieving the physical bitmap sprite.
     */
    public Bitmap getSprite();

    /**
     * Defines a getter for the x coordinate.
     */
    public int getX();

    /**
     * defines a getter for the y coordinate.
     */
    public int getY();

    /**
     * Defines velocity for x.
     */
    public int getVelX();

    /**
     * Defines velocity for y.
     */
    public int getVelY();

    /**
     * Defines a boolean for accessing whether an object is colliding with another or not.
     */
    public boolean isCollidedWith(Entity e);

    /**
     * Define a getter to get the entity's associated collision rectangle.
     */
    public Rect getCollisionBox();

}




Java Source Code List

eu.raffprta.rockfall.app.GameCanvas.java
eu.raffprta.rockfall.app.GameIntent.java
eu.raffprta.rockfall.app.GameScreen.java
eu.raffprta.rockfall.app.MainGame.java
eu.raffprta.rockfall.app.MenuCanvas.java
eu.raffprta.rockfall.app.SpriteContainer.java
eu.raffprta.rockfall.app.StopWatch.java
eu.raffprta.rockfall.app.TouchHandler.java
eu.raffprta.rockfall.core.entity.AbstractEntity.java
eu.raffprta.rockfall.core.entity.EntityFactory.java
eu.raffprta.rockfall.core.entity.Entity.java
eu.raffprta.rockfall.core.entity.FallableType.java
eu.raffprta.rockfall.core.entity.Fallable.java
eu.raffprta.rockfall.core.entity.Powerup.java
eu.raffprta.rockfall.core.entity.Protagonist.java
eu.raffprta.rockfall.core.entity.Rock.java
eu.raffprta.rockfall.core.sprite.SpriteFactory.java
eu.raffprta.rockfall.core.sprite.SpriteSheet.java
eu.raffprta.rockfall.core.sprite.Sprite.java