-
Notifications
You must be signed in to change notification settings - Fork 2
/
GameLogic.java
52 lines (42 loc) · 1.11 KB
/
GameLogic.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package com.coldwild.dodginghero.logic;
import com.badlogic.gdx.math.MathUtils;
import com.coldwild.dodginghero.graph.effects.EffectEngine;
import com.coldwild.dodginghero.logic.objects.Player;
/**
* Created by comrad_gremlin on 9/8/2016.
*/
public class GameLogic {
public static final int MAX_BASE_X = 3;
public static final int MAX_BASE_Y = 3;
Player player;
EffectEngine effectEngine;
public GameLogic() {
player = new Player(
MathUtils.random(MAX_BASE_X),
MathUtils.random(MAX_BASE_Y)
); // 0..3
effectEngine = new EffectEngine();
}
public Player getPlayer()
{
return player;
}
public void update(float delta)
{
effectEngine.update(delta);
}
public boolean CanMove(int fx, int fy)
{
return (fx >= 0 && fx <= MAX_BASE_X) &&
(fy >= 0 && fy <= MAX_BASE_Y);
}
public void AssignPlayerPosition(int fx, int fy)
{
player.setFieldX(fx);
player.setFieldY(fy);
}
public EffectEngine getEffectEngine()
{
return effectEngine;
}
}