-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameObject2D.java
More file actions
41 lines (39 loc) · 1.07 KB
/
Copy pathGameObject2D.java
File metadata and controls
41 lines (39 loc) · 1.07 KB
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
package awpsoft.gamemodule;
public class GameObject2D extends TimeVariantObject
{
public boolean Enable, Visible, WillDestory, ExistLifeTime;
public float PosCenterX, PosCenterY, PicCenterX, PicCenterY, RotationDEG, SecondaryAlpha, WScale, HScale;
public long LifeTime;
public GameObject2D()
{
WillDestory = ExistLifeTime = false;
Visible = true;
Enable = true;
PosCenterX = PosCenterY = PicCenterX = PicCenterY = RotationDEG = 0.0f;
SecondaryAlpha = WScale = HScale = 1.0f;
LifeTime = Long.MAX_VALUE;
}
@Override public boolean giveTime(int timeGived)
{
if (!super.giveTime(timeGived) || !Enable) return false;
if (ExistLifeTime)
{
LifeTime -= timeGived;
if (LifeTime <= 0)
{
Enable = false;
WillDestory = true;
}
}
return true;
}
@Override public void reset()
{
WillDestory = ExistLifeTime = false;
PosCenterX = PosCenterY = PicCenterX = PicCenterY = RotationDEG = 0.0f;
SecondaryAlpha = WScale = HScale = 1.0f;
Visible = true;
Enable = true;
LifeTime = Long.MAX_VALUE;
}
};