Minor work on animation
This commit is contained in:
		@@ -1,23 +1,7 @@
 | 
			
		||||
package pp.mdga.client.Animation;
 | 
			
		||||
 | 
			
		||||
import pp.mdga.client.MdgaApp;
 | 
			
		||||
 | 
			
		||||
public class Animation {
 | 
			
		||||
    private MdgaApp app;
 | 
			
		||||
 | 
			
		||||
    Animation(MdgaApp app_) {
 | 
			
		||||
        app = app_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void play() {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    void update(float tpf) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    boolean isFinished() {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
public interface Animation {
 | 
			
		||||
    void play();
 | 
			
		||||
    void stop();
 | 
			
		||||
    boolean isOver();
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -5,11 +5,25 @@
 | 
			
		||||
public class AnimationHandler {
 | 
			
		||||
    private MdgaApp app;
 | 
			
		||||
 | 
			
		||||
    private Animation animation = null;
 | 
			
		||||
 | 
			
		||||
    public AnimationHandler(MdgaApp app_) {
 | 
			
		||||
        app = app_;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void playAnimation() {
 | 
			
		||||
    public void playAnimation(AnimationType type) {
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public void update() {
 | 
			
		||||
        if(null == animation) {
 | 
			
		||||
            return;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if(animation.isOver()) {
 | 
			
		||||
            animation = null;
 | 
			
		||||
 | 
			
		||||
            //trigger next state
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,4 @@
 | 
			
		||||
package pp.mdga.client.Animation;
 | 
			
		||||
 | 
			
		||||
public enum AnimationType {
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,18 @@
 | 
			
		||||
package pp.mdga.client.Animation;
 | 
			
		||||
 | 
			
		||||
public class EmptyAnimation implements Animation {
 | 
			
		||||
    @Override
 | 
			
		||||
    void play() {
 | 
			
		||||
        //nothing
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    void stop() {
 | 
			
		||||
        //nothing
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    boolean isOver() {
 | 
			
		||||
        return true;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -4,12 +4,13 @@
 | 
			
		||||
 | 
			
		||||
public class BoardView {
 | 
			
		||||
    private static final float GRID_SIZE = 10.0f;
 | 
			
		||||
    private static final float GRID_LEVEL = 0.0f;
 | 
			
		||||
    private static final float GRID_ELEVATION = 0.0f;
 | 
			
		||||
    private static final int GRID_EXTEND = 11;
 | 
			
		||||
 | 
			
		||||
    private static Vector3f gridToWorld(int x, int y) {
 | 
			
		||||
        assert(x >= 0);
 | 
			
		||||
        assert(y >= 0);
 | 
			
		||||
        assert(0 <= x && x < GRID_EXTEND);
 | 
			
		||||
        assert(0 <= y && y < GRID_EXTEND);
 | 
			
		||||
 | 
			
		||||
        return new Vector3f(GRID_SIZE * x, GRID_LEVEL, GRID_SIZE * y);
 | 
			
		||||
        return new Vector3f(GRID_SIZE * x, GRID_ELEVATION, GRID_SIZE * y);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -0,0 +1,4 @@
 | 
			
		||||
package pp.mdga.effect;
 | 
			
		||||
 | 
			
		||||
public interface Effect {
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user