Minor work on animation

This commit is contained in:
Felix
2024-11-14 14:58:54 +01:00
parent d9a827697d
commit 6849a0a023
6 changed files with 50 additions and 25 deletions

View File

@@ -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();
}

View File

@@ -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
}
}
}

View File

@@ -0,0 +1,4 @@
package pp.mdga.client.Animation;
public enum AnimationType {
}

View File

@@ -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;
}
}

View File

@@ -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);
}
}

View File

@@ -0,0 +1,4 @@
package pp.mdga.effect;
public interface Effect {
}