Android Open Source - Sneik Bird






From Project

Back to project page Sneik.

License

The source code is released under:

Apache License

If you think the Android project Sneik 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 net.plastboks.gameobjects;
//from ww w.ja  v a2  s. c om
import com.badlogic.gdx.graphics.g2d.TextureRegion;
import net.plastboks.sneikhelpers.AssetLoader;

/**
 * Created by alex on 12/15/14.
 */
public class Bird extends Autonomous
{
    private float lvl = 0.2f;
    private int score = 1;
    private float lvlInc = 0.2f;
    private float maxLvl = 1.6f;

    public static final int width = 15;
    public static final int height = 15;

    public Bird() {
        super(width, height);
        setFactor(1000);
        setDivider(97);
    }

    public Bird(int speed) {
        this();
        for (int i = 0; i < speed; i++) { incrementSpeed(); }
    }


    public void update(float delta) {
        changeDir();
        move(delta + lvl);
    }

    public void setLvl(float lvl) { this.lvl = lvl; }

    public TextureRegion getTexture() { return AssetLoader.bird; }

    public void playSound() { AssetLoader.coin.play(); }
    public int getScore() { return score; }

    public void incrementSpeed() {
        if (lvl + lvlInc <= maxLvl) { lvl += lvlInc; }
    }
}




Java Source Code List

net.plastboks.gameobjects.Artificial.java
net.plastboks.gameobjects.Autonomous.java
net.plastboks.gameobjects.Bird.java
net.plastboks.gameobjects.Creature.java
net.plastboks.gameobjects.Mouse.java
net.plastboks.gameobjects.Node.java
net.plastboks.gameobjects.Snake.java
net.plastboks.gameworld.GamePlay.java
net.plastboks.gameworld.GameRenderer.java
net.plastboks.gameworld.GameWorld.java
net.plastboks.screens.GameScreen.java
net.plastboks.shared.Directions.java
net.plastboks.sneik.IOSLauncher.java
net.plastboks.sneik.SneikGame.java
net.plastboks.sneik.android.AndroidLauncher.java
net.plastboks.sneik.client.HtmlLauncher.java
net.plastboks.sneik.desktop.DesktopLauncher.java
net.plastboks.sneikhelpers.AssetLoader.java
net.plastboks.sneikhelpers.InputHandler.java