Particles!
parent
49f7d36b8e
commit
40cc3ed7ed
|
@ -0,0 +1,149 @@
|
||||||
|
slugs
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 10000.0
|
||||||
|
lowMax: 10000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 2.0
|
||||||
|
lowMax: 2.0
|
||||||
|
highMin: 4.0
|
||||||
|
highMax: 4.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 500.0
|
||||||
|
highMax: 750.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.66
|
||||||
|
timeline2: 1.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 20.0
|
||||||
|
highMax: 20.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 359.0
|
||||||
|
highMax: 359.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.999
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 9
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
colors3: 0.0
|
||||||
|
colors4: 0.0
|
||||||
|
colors5: 0.0
|
||||||
|
colors6: 1.0
|
||||||
|
colors7: 1.0
|
||||||
|
colors8: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.050933786
|
||||||
|
timeline2: 1.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 0.0
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.21232876
|
||||||
|
timeline2: 0.65068495
|
||||||
|
timeline3: 0.9794521
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
/home/emamaker/github/amazeing/gdx/core/assets/data/powerups/ball_and_chain.png
|
||||||
|
|
|
@ -0,0 +1,142 @@
|
||||||
|
Untitled
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 5000.0
|
||||||
|
lowMax: 5000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 1.0
|
||||||
|
lowMax: 1.0
|
||||||
|
highMin: 10.0
|
||||||
|
highMax: 10.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 150.0
|
||||||
|
highMax: 350.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 0.9183673
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.66
|
||||||
|
timeline2: 1.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 200.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 200.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 300.0
|
||||||
|
lowMax: 300.0
|
||||||
|
highMin: 400.0
|
||||||
|
highMax: 400.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 3.0
|
||||||
|
highMax: 3.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.0
|
||||||
|
scaling2: 0.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.5
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 3
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 1.0
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.25342464
|
||||||
|
timeline2: 0.60761464
|
||||||
|
timeline3: 0.98057497
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: random
|
||||||
|
- Image Paths -
|
||||||
|
explosion.png
|
||||||
|
boom.png
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -0,0 +1,313 @@
|
||||||
|
explosion
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 1000.0
|
||||||
|
lowMax: 1000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 2.0
|
||||||
|
lowMax: 2.0
|
||||||
|
highMin: 5.0
|
||||||
|
highMax: 5.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 5
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 1.0
|
||||||
|
scaling4: 0.59183675
|
||||||
|
timelineCount: 5
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.1509288
|
||||||
|
timeline2: 0.39041096
|
||||||
|
timeline3: 0.72602737
|
||||||
|
timeline4: 0.86986303
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 1000.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 6
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 1.0
|
||||||
|
scaling4: 1.0
|
||||||
|
scaling5: 1.0
|
||||||
|
timelineCount: 6
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.113777086
|
||||||
|
timeline2: 0.47678018
|
||||||
|
timeline3: 0.5944272
|
||||||
|
timeline4: 0.7972136
|
||||||
|
timeline5: 0.89860684
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 200.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 0.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.98630136
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 200.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 0.020408163
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 40.0
|
||||||
|
lowMax: 40.0
|
||||||
|
highMin: 80.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 6
|
||||||
|
scaling0: 0.039325844
|
||||||
|
scaling1: 0.2977528
|
||||||
|
scaling2: 0.6011236
|
||||||
|
scaling3: 0.71910113
|
||||||
|
scaling4: 0.8707865
|
||||||
|
scaling5: 1.0
|
||||||
|
timelineCount: 6
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.16331269
|
||||||
|
timeline2: 0.29256967
|
||||||
|
timeline3: 0.46826625
|
||||||
|
timeline4: 0.65634674
|
||||||
|
timeline5: 0.996904
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 3.0
|
||||||
|
highMax: 3.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.0
|
||||||
|
scaling2: 0.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.5
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 3
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.6666667
|
||||||
|
scaling2: 0.84210527
|
||||||
|
scaling3: 0.24561404
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.26027396
|
||||||
|
timeline2: 0.60273975
|
||||||
|
timeline3: 0.9109589
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
explosion.png
|
||||||
|
|
||||||
|
|
||||||
|
boom
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 1500.0
|
||||||
|
lowMax: 1500.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 25
|
||||||
|
- Emission -
|
||||||
|
lowMin: 1.0
|
||||||
|
lowMax: 1.0
|
||||||
|
highMin: 2.0
|
||||||
|
highMax: 2.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 5
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 0.67346936
|
||||||
|
scaling3: 0.0
|
||||||
|
scaling4: 0.0
|
||||||
|
timelineCount: 5
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.15413533
|
||||||
|
timeline2: 0.42465752
|
||||||
|
timeline3: 0.5068493
|
||||||
|
timeline4: 0.99303406
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 500.0
|
||||||
|
highMax: 500.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: ellipse
|
||||||
|
edges: false
|
||||||
|
side: both
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 10.0
|
||||||
|
lowMax: 10.0
|
||||||
|
highMin: 30.0
|
||||||
|
highMax: 80.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.37078652
|
||||||
|
scaling1: 0.75842696
|
||||||
|
scaling2: 0.96067417
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.38467494
|
||||||
|
timeline2: 0.996904
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: false
|
||||||
|
- Angle -
|
||||||
|
active: false
|
||||||
|
- Rotation -
|
||||||
|
active: true
|
||||||
|
lowMin: -15.0
|
||||||
|
lowMax: -15.0
|
||||||
|
highMin: 5.0
|
||||||
|
highMax: 5.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 3
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: true
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
boom.png
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -0,0 +1,313 @@
|
||||||
|
explosion
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 1000.0
|
||||||
|
lowMax: 1000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 2.0
|
||||||
|
lowMax: 2.0
|
||||||
|
highMin: 5.0
|
||||||
|
highMax: 5.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 5
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 1.0
|
||||||
|
scaling4: 0.59183675
|
||||||
|
timelineCount: 5
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.1509288
|
||||||
|
timeline2: 0.39041096
|
||||||
|
timeline3: 0.72602737
|
||||||
|
timeline4: 0.86986303
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 1000.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 6
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 1.0
|
||||||
|
scaling4: 1.0
|
||||||
|
scaling5: 1.0
|
||||||
|
timelineCount: 6
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.113777086
|
||||||
|
timeline2: 0.47678018
|
||||||
|
timeline3: 0.5944272
|
||||||
|
timeline4: 0.7972136
|
||||||
|
timeline5: 0.89860684
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 0.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.98630136
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 0.020408163
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 40.0
|
||||||
|
lowMax: 40.0
|
||||||
|
highMin: 50.0
|
||||||
|
highMax: 70.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 6
|
||||||
|
scaling0: 0.039325844
|
||||||
|
scaling1: 0.2977528
|
||||||
|
scaling2: 0.6011236
|
||||||
|
scaling3: 0.71910113
|
||||||
|
scaling4: 0.8707865
|
||||||
|
scaling5: 1.0
|
||||||
|
timelineCount: 6
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.16331269
|
||||||
|
timeline2: 0.29256967
|
||||||
|
timeline3: 0.46826625
|
||||||
|
timeline4: 0.65634674
|
||||||
|
timeline5: 0.996904
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 3.0
|
||||||
|
highMax: 3.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.0
|
||||||
|
scaling2: 0.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.5
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 3
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.71929824
|
||||||
|
scaling2: 0.8596491
|
||||||
|
scaling3: 0.36842105
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.33561644
|
||||||
|
timeline2: 0.65753424
|
||||||
|
timeline3: 0.96575344
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
explosion.png
|
||||||
|
|
||||||
|
|
||||||
|
boom
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 1500.0
|
||||||
|
lowMax: 1500.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 25
|
||||||
|
- Emission -
|
||||||
|
lowMin: 1.0
|
||||||
|
lowMax: 1.0
|
||||||
|
highMin: 2.0
|
||||||
|
highMax: 2.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 5
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 0.67346936
|
||||||
|
scaling3: 0.0
|
||||||
|
scaling4: 0.0
|
||||||
|
timelineCount: 5
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.15413533
|
||||||
|
timeline2: 0.42465752
|
||||||
|
timeline3: 0.5068493
|
||||||
|
timeline4: 0.99303406
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 500.0
|
||||||
|
highMax: 500.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: ellipse
|
||||||
|
edges: false
|
||||||
|
side: both
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 100.0
|
||||||
|
highMax: 100.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 10.0
|
||||||
|
lowMax: 10.0
|
||||||
|
highMin: 30.0
|
||||||
|
highMax: 80.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.37078652
|
||||||
|
scaling1: 0.75842696
|
||||||
|
scaling2: 0.96067417
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.38467494
|
||||||
|
timeline2: 0.996904
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: false
|
||||||
|
- Angle -
|
||||||
|
active: false
|
||||||
|
- Rotation -
|
||||||
|
active: true
|
||||||
|
lowMin: -15.0
|
||||||
|
lowMax: -15.0
|
||||||
|
highMin: 5.0
|
||||||
|
highMax: 5.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 3
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: true
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
boom.png
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
slugs
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 10000.0
|
||||||
|
lowMax: 10000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 2.0
|
||||||
|
lowMax: 2.0
|
||||||
|
highMin: 4.0
|
||||||
|
highMax: 4.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 500.0
|
||||||
|
highMax: 750.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.66
|
||||||
|
timeline2: 1.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 20.0
|
||||||
|
highMax: 20.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 359.0
|
||||||
|
highMax: 359.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.999
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 9
|
||||||
|
colors0: 1.0
|
||||||
|
colors1: 1.0
|
||||||
|
colors2: 1.0
|
||||||
|
colors3: 1.0
|
||||||
|
colors4: 1.0
|
||||||
|
colors5: 1.0
|
||||||
|
colors6: 1.0
|
||||||
|
colors7: 1.0
|
||||||
|
colors8: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.01
|
||||||
|
timeline2: 1.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 0.0
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.21232876
|
||||||
|
timeline2: 0.65068495
|
||||||
|
timeline3: 0.9794521
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
/home/emamaker/github/amazeing/gdx/core/assets/data/powerups/feather.png
|
||||||
|
|
|
@ -0,0 +1,149 @@
|
||||||
|
slugs
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 15000.0
|
||||||
|
lowMax: 15000.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 200
|
||||||
|
- Emission -
|
||||||
|
lowMin: 2.0
|
||||||
|
lowMax: 2.0
|
||||||
|
highMin: 4.0
|
||||||
|
highMax: 4.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 500.0
|
||||||
|
highMax: 750.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.66
|
||||||
|
timeline2: 1.0
|
||||||
|
independent: false
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
independent: false
|
||||||
|
- X Offset -
|
||||||
|
active: false
|
||||||
|
- Y Offset -
|
||||||
|
active: false
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 60.0
|
||||||
|
highMax: 60.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- X Scale -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 20.0
|
||||||
|
highMax: 20.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Y Scale -
|
||||||
|
active: false
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 359.0
|
||||||
|
highMax: 359.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.999
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 9
|
||||||
|
colors0: 0.58431375
|
||||||
|
colors1: 0.8784314
|
||||||
|
colors2: 0.43529412
|
||||||
|
colors3: 0.0
|
||||||
|
colors4: 0.0
|
||||||
|
colors5: 0.0
|
||||||
|
colors6: 1.0
|
||||||
|
colors7: 1.0
|
||||||
|
colors8: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.050933786
|
||||||
|
timeline2: 1.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 0.0
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.21232876
|
||||||
|
timeline2: 0.65068495
|
||||||
|
timeline3: 0.9794521
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: false
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
spriteMode: single
|
||||||
|
- Image Paths -
|
||||||
|
/home/emamaker/github/amazeing/gdx/core/assets/data/powerups/slug.png
|
||||||
|
|
|
@ -6,7 +6,10 @@ import com.badlogic.gdx.Game;
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.badlogic.gdx.InputMultiplexer;
|
import com.badlogic.gdx.InputMultiplexer;
|
||||||
import com.badlogic.gdx.graphics.FPSLogger;
|
import com.badlogic.gdx.graphics.FPSLogger;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
|
||||||
import com.badlogic.gdx.physics.bullet.Bullet;
|
import com.badlogic.gdx.physics.bullet.Bullet;
|
||||||
|
import com.badlogic.gdx.utils.Array;
|
||||||
import com.emamaker.amazeing.manager.GameManager;
|
import com.emamaker.amazeing.manager.GameManager;
|
||||||
import com.emamaker.amazeing.manager.managers.GameManagerLocal;
|
import com.emamaker.amazeing.manager.managers.GameManagerLocal;
|
||||||
import com.emamaker.amazeing.manager.network.GameClient;
|
import com.emamaker.amazeing.manager.network.GameClient;
|
||||||
|
@ -39,6 +42,12 @@ public class AMazeIng extends Game {
|
||||||
|
|
||||||
public static Platform PLATFORM;
|
public static Platform PLATFORM;
|
||||||
|
|
||||||
|
public float delta = 0;
|
||||||
|
|
||||||
|
public SpriteBatch spriteBatch;
|
||||||
|
public Array<PooledEffect> effects = new Array<PooledEffect>();
|
||||||
|
|
||||||
|
|
||||||
public AMazeIng(Platform p) {
|
public AMazeIng(Platform p) {
|
||||||
PLATFORM = p;
|
PLATFORM = p;
|
||||||
}
|
}
|
||||||
|
@ -68,6 +77,8 @@ public class AMazeIng extends Game {
|
||||||
setupGUI();
|
setupGUI();
|
||||||
setupGameManager();
|
setupGameManager();
|
||||||
setupPowerUps();
|
setupPowerUps();
|
||||||
|
|
||||||
|
spriteBatch = new SpriteBatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setupGUI() {
|
public void setupGUI() {
|
||||||
|
@ -94,17 +105,43 @@ public class AMazeIng extends Game {
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
super.render();
|
super.render();
|
||||||
|
delta = Math.min(1f / 30f, Gdx.graphics.getDeltaTime());
|
||||||
|
|
||||||
server.update();
|
server.update();
|
||||||
client.update();
|
client.update();
|
||||||
gameManager.update();
|
gameManager.update();
|
||||||
|
|
||||||
|
spriteBatch.begin();
|
||||||
|
// Update and draw effects:
|
||||||
|
for (int i = effects.size - 1; i >= 0; i--) {
|
||||||
|
PooledEffect effect = effects.get(i);
|
||||||
|
effect.draw(spriteBatch, delta);
|
||||||
|
if (effect.isComplete()) {
|
||||||
|
effect.free();
|
||||||
|
effects.removeIndex(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
spriteBatch.end();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void dispose() {
|
public void dispose() {
|
||||||
gameManager.dispose();
|
gameManager.dispose();
|
||||||
|
if (server.isRunning())
|
||||||
|
client.stop(true);
|
||||||
|
else
|
||||||
client.stop();
|
client.stop();
|
||||||
server.stop();
|
server.stop();
|
||||||
world.dispose();
|
world.dispose();
|
||||||
|
clearEffects();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clearEffects() {
|
||||||
|
// Reset all effects:
|
||||||
|
for (int i = effects.size - 1; i >= 0; i--)
|
||||||
|
effects.get(i).free(); //free all the effects back to the pool
|
||||||
|
effects.clear(); //clear the current effects array
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -173,8 +173,10 @@ public class GameManager {
|
||||||
|
|
||||||
public void checkWin() {
|
public void checkWin() {
|
||||||
for (MazePlayer p : players)
|
for (MazePlayer p : players)
|
||||||
if (checkWin(p))
|
if (checkWin(p)) {
|
||||||
setFinished();
|
setFinished();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFinished() {
|
public void setFinished() {
|
||||||
|
@ -183,7 +185,7 @@ public class GameManager {
|
||||||
|
|
||||||
for (MazePlayer p : players)
|
for (MazePlayer p : players)
|
||||||
p.disablePowerUp();
|
p.disablePowerUp();
|
||||||
|
main.clearEffects();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getFinished() {
|
public boolean getFinished() {
|
||||||
|
@ -321,7 +323,7 @@ public class GameManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestChangeToMap(int[][] todraw) {
|
public void requestChangeToMap(int[][] todraw) {
|
||||||
mazeGen.requestChangeToMap(todraw);
|
mazeGen.show(todraw);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void resetCamera() {
|
public void resetCamera() {
|
||||||
|
|
|
@ -10,7 +10,6 @@ import com.emamaker.amazeing.AMazeIng;
|
||||||
import com.emamaker.amazeing.manager.managers.GameManagerClient;
|
import com.emamaker.amazeing.manager.managers.GameManagerClient;
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.client.game.NACGameStatusUpdate;
|
import com.emamaker.amazeing.manager.network.action.actions.client.game.NACGameStatusUpdate;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.client.game.NACServerClosed;
|
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.client.game.NACUpdateMap;
|
import com.emamaker.amazeing.manager.network.action.actions.client.game.NACUpdateMap;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.client.login.NACLoginAO;
|
import com.emamaker.amazeing.manager.network.action.actions.client.login.NACLoginAO;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.client.login.NACLoginAO2;
|
import com.emamaker.amazeing.manager.network.action.actions.client.login.NACLoginAO2;
|
||||||
|
@ -22,6 +21,7 @@ import com.emamaker.amazeing.maze.settings.MazeSettings;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
import com.emamaker.amazeing.player.MazePlayerLocal;
|
import com.emamaker.amazeing.player.MazePlayerLocal;
|
||||||
import com.emamaker.amazeing.player.PlayerUtils;
|
import com.emamaker.amazeing.player.PlayerUtils;
|
||||||
|
import com.emamaker.amazeing.utils.MathUtils.Constants;
|
||||||
import com.esotericsoftware.kryonet.Client;
|
import com.esotericsoftware.kryonet.Client;
|
||||||
|
|
||||||
public class GameClient extends NetworkHandler {
|
public class GameClient extends NetworkHandler {
|
||||||
|
@ -29,7 +29,7 @@ public class GameClient extends NetworkHandler {
|
||||||
public Client client;
|
public Client client;
|
||||||
String addr;
|
String addr;
|
||||||
|
|
||||||
boolean updateMobilePlayers = false;
|
boolean updateMobilePlayers = true;
|
||||||
|
|
||||||
public CopyOnWriteArrayList<String> localPlayers = new CopyOnWriteArrayList<String>();
|
public CopyOnWriteArrayList<String> localPlayers = new CopyOnWriteArrayList<String>();
|
||||||
|
|
||||||
|
@ -72,7 +72,6 @@ public class GameClient extends NetworkHandler {
|
||||||
actions.add(new NACUpdatePlayerPosForced(this));
|
actions.add(new NACUpdatePlayerPosForced(this));
|
||||||
actions.add(new NACUpdatePlayersPos(this));
|
actions.add(new NACUpdatePlayersPos(this));
|
||||||
actions.add(new NACUpdateOtherPlayerPos(this));
|
actions.add(new NACUpdateOtherPlayerPos(this));
|
||||||
actions.add(new NACServerClosed(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -85,6 +84,12 @@ public class GameClient extends NetworkHandler {
|
||||||
super.update();
|
super.update();
|
||||||
|
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
|
//Check if the server disconnected or it's timing out
|
||||||
|
if(!client.isConnected() || ((NACGameStatusUpdate.gotMessage && System.currentTimeMillis() - NACGameStatusUpdate.lastMsgTime > Constants.COMMUNICATION_TIMEOUT_MILLIS))) {
|
||||||
|
stop(true);
|
||||||
|
main.uiManager.srvJoinScreen.showErrorDlg(1);
|
||||||
|
}
|
||||||
|
//Normal client update
|
||||||
if (gameManager != null) {
|
if (gameManager != null) {
|
||||||
if (gameManager.gameStarted) {
|
if (gameManager.gameStarted) {
|
||||||
} else {
|
} else {
|
||||||
|
@ -106,26 +111,39 @@ public class GameClient extends NetworkHandler {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void stop() {
|
public void stop() {
|
||||||
|
stop(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stop(boolean fromserver) {
|
||||||
if (isRunning()) {
|
if (isRunning()) {
|
||||||
|
if (!fromserver) {
|
||||||
for (String s : localPlayers) {
|
for (String s : localPlayers) {
|
||||||
((NACRemovePlayer) getActionByClass(NACRemovePlayer.class)).startAction(null, null, s);
|
((NACRemovePlayer) getActionByClass(NACRemovePlayer.class)).startAction(null, null, s);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (MazePlayer p : players.values())
|
for (MazePlayer p : players.values())
|
||||||
p.dispose();
|
p.dispose();
|
||||||
players.clear();
|
players.clear();
|
||||||
|
|
||||||
|
|
||||||
|
if (!fromserver) {
|
||||||
for (NetworkAction n : pendingActions)
|
for (NetworkAction n : pendingActions)
|
||||||
n.onParentClosing();
|
n.onParentClosing();
|
||||||
|
|
||||||
while (!pendingActions.isEmpty())
|
while (!pendingActions.isEmpty())
|
||||||
update();
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
pendingActions.clear();
|
||||||
|
todoActions.clear();
|
||||||
|
actions.clear();
|
||||||
|
|
||||||
client.stop();
|
client.stop();
|
||||||
running = false;
|
running = false;
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* CHECKING FOR NEW PLAYERS */
|
/* CHECKING FOR NEW PLAYERS */
|
||||||
|
|
|
@ -7,7 +7,6 @@ import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
|
||||||
import com.emamaker.amazeing.manager.managers.GameManagerServer;
|
import com.emamaker.amazeing.manager.managers.GameManagerServer;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.game.NASGameStatusUpdate;
|
import com.emamaker.amazeing.manager.network.action.actions.server.game.NASGameStatusUpdate;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.game.NASServerClosed;
|
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.game.NASUpdateMap;
|
import com.emamaker.amazeing.manager.network.action.actions.server.game.NASUpdateMap;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.login.NASLoginAO2;
|
import com.emamaker.amazeing.manager.network.action.actions.server.login.NASLoginAO2;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.login.NASLoginUUID;
|
import com.emamaker.amazeing.manager.network.action.actions.server.login.NASLoginUUID;
|
||||||
|
@ -15,6 +14,7 @@ import com.emamaker.amazeing.manager.network.action.actions.server.login.NASRemo
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.player.NASUpdatePlayerPos;
|
import com.emamaker.amazeing.manager.network.action.actions.server.player.NASUpdatePlayerPos;
|
||||||
import com.emamaker.amazeing.manager.network.action.actions.server.player.NASUpdatePlayerPosForced;
|
import com.emamaker.amazeing.manager.network.action.actions.server.player.NASUpdatePlayerPosForced;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
|
import com.emamaker.amazeing.utils.MathUtils.Constants;
|
||||||
import com.esotericsoftware.kryonet.Server;
|
import com.esotericsoftware.kryonet.Server;
|
||||||
|
|
||||||
public class GameServer extends NetworkHandler {
|
public class GameServer extends NetworkHandler {
|
||||||
|
@ -26,7 +26,6 @@ public class GameServer extends NetworkHandler {
|
||||||
// Returns true if the server started successfully
|
// Returns true if the server started successfully
|
||||||
public boolean start(int port_) {
|
public boolean start(int port_) {
|
||||||
port = port_;
|
port = port_;
|
||||||
running = true;
|
|
||||||
try {
|
try {
|
||||||
server = new Server();
|
server = new Server();
|
||||||
// For consistency, the classes to be sent over the network are
|
// For consistency, the classes to be sent over the network are
|
||||||
|
@ -41,6 +40,8 @@ public class GameServer extends NetworkHandler {
|
||||||
startDefaultActions();
|
startDefaultActions();
|
||||||
|
|
||||||
System.out.println("Server registered and running on port " + port);
|
System.out.println("Server registered and running on port " + port);
|
||||||
|
|
||||||
|
running = true;
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
@ -59,7 +60,6 @@ public class GameServer extends NetworkHandler {
|
||||||
actions.add(new NASUpdateMap(this));
|
actions.add(new NASUpdateMap(this));
|
||||||
actions.add(new NASUpdatePlayerPosForced(this));
|
actions.add(new NASUpdatePlayerPosForced(this));
|
||||||
actions.add(new NASUpdatePlayerPos(this));
|
actions.add(new NASUpdatePlayerPos(this));
|
||||||
actions.add(new NASServerClosed(this));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -68,6 +68,22 @@ public class GameServer extends NetworkHandler {
|
||||||
// getActionByClass(NAServerUpdatePlayers.class).startAction(null, null);
|
// getActionByClass(NAServerUpdatePlayers.class).startAction(null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update() {
|
||||||
|
super.update();
|
||||||
|
|
||||||
|
if(isRunning()) {
|
||||||
|
//Check if there's some player not responding that needs to be removed
|
||||||
|
for(String s: players.keySet()) {
|
||||||
|
if(System.currentTimeMillis() - players.get(s).LAST_NETWORK_TIME > Constants.COMMUNICATION_TIMEOUT_MILLIS) {
|
||||||
|
players.get(s).dispose();
|
||||||
|
players.remove(s);
|
||||||
|
}
|
||||||
|
System.out.println(Arrays.toString(players.values().toArray()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void periodicNonGameUpdate() {
|
public void periodicNonGameUpdate() {
|
||||||
}
|
}
|
||||||
|
@ -99,9 +115,12 @@ public class GameServer extends NetworkHandler {
|
||||||
for (MazePlayer p : players.values()) {
|
for (MazePlayer p : players.values()) {
|
||||||
p.dispose();
|
p.dispose();
|
||||||
players.clear();
|
players.clear();
|
||||||
getActionByClass(NASServerClosed.class).startAction(null, null);
|
|
||||||
server.stop();
|
server.stop();
|
||||||
running = false;
|
running = false;
|
||||||
|
|
||||||
|
pendingActions.clear();
|
||||||
|
todoActions.clear();
|
||||||
|
actions.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
package com.emamaker.amazeing.manager.network;
|
package com.emamaker.amazeing.manager.network;
|
||||||
|
|
||||||
import java.util.concurrent.ConcurrentHashMap;
|
|
||||||
import java.util.concurrent.ConcurrentLinkedQueue;
|
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector3;
|
import com.badlogic.gdx.math.Vector3;
|
||||||
import com.emamaker.amazeing.AMazeIng;
|
import com.emamaker.amazeing.AMazeIng;
|
||||||
import com.emamaker.amazeing.manager.GameManager;
|
import com.emamaker.amazeing.manager.GameManager;
|
||||||
|
@ -12,6 +8,10 @@ import com.emamaker.amazeing.manager.network.NetworkCommon.UpdatePlayerPosition;
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.concurrent.ConcurrentHashMap;
|
||||||
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
public abstract class NetworkHandler {
|
public abstract class NetworkHandler {
|
||||||
|
|
||||||
public ConcurrentHashMap<String, MazePlayer> players = new ConcurrentHashMap<String, MazePlayer>();
|
public ConcurrentHashMap<String, MazePlayer> players = new ConcurrentHashMap<String, MazePlayer>();
|
||||||
|
@ -26,7 +26,7 @@ public abstract class NetworkHandler {
|
||||||
// Some actions (such as the first step of login) cannot be done in multiple
|
// Some actions (such as the first step of login) cannot be done in multiple
|
||||||
// instances at the same time
|
// instances at the same time
|
||||||
// Actions of this type have to be stored here
|
// Actions of this type have to be stored here
|
||||||
public ConcurrentLinkedQueue<NetworkAction> todoActions = new ConcurrentLinkedQueue<>();
|
public CopyOnWriteArrayList<NetworkAction> todoActions = new CopyOnWriteArrayList<>();
|
||||||
CopyOnWriteArrayList<NetworkAction> deletePending = new CopyOnWriteArrayList<>();
|
CopyOnWriteArrayList<NetworkAction> deletePending = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
int port;
|
int port;
|
||||||
|
@ -61,11 +61,23 @@ public abstract class NetworkHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updatePending() {
|
public void updatePending() {
|
||||||
if (!todoActions.isEmpty()) {
|
//System.out.println(Arrays.toString(todoActions.toArray()));
|
||||||
if (!alreadyPending(todoActions.peek()))
|
for(NetworkAction a : todoActions) {
|
||||||
todoActions.peek().startAction(null, null);
|
if(!alreadyPending(a)) {
|
||||||
addToPending(todoActions.remove());
|
System.out.println(a);
|
||||||
|
addToPending(a);
|
||||||
|
todoActions.remove(a);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (!todoActions.isEmpty()) {
|
||||||
|
// System.out.println("Actions queue: " + Arrays.toString(todoActions.toArray()));
|
||||||
|
// if (!alreadyPending(todoActions.peek())) {
|
||||||
|
// todoActions.peek().startAction(null, null);
|
||||||
|
// System.out.println("Getting action from queue: " + todoActions.peek());
|
||||||
|
// addToPending(todoActions.remove());
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
for (NetworkAction n : pendingActions)
|
for (NetworkAction n : pendingActions)
|
||||||
n.update();
|
n.update();
|
||||||
|
@ -75,7 +87,7 @@ public abstract class NetworkHandler {
|
||||||
* Unluckily, we can't check if a specific action is already pending. But we can
|
* Unluckily, we can't check if a specific action is already pending. But we can
|
||||||
* check if there's another type of the same action running. NetworkActions can
|
* check if there's another type of the same action running. NetworkActions can
|
||||||
* override the startAction method to be started even if there's another one
|
* override the startAction method to be started even if there's another one
|
||||||
* already running (e.g. PositionUpdates)
|
* already running (e.g. Player Removal)
|
||||||
*/
|
*/
|
||||||
public boolean alreadyPending(NetworkAction act) {
|
public boolean alreadyPending(NetworkAction act) {
|
||||||
for (NetworkAction a : pendingActions) {
|
for (NetworkAction a : pendingActions) {
|
||||||
|
@ -83,6 +95,10 @@ public abstract class NetworkHandler {
|
||||||
// System.out.println("Already pending " + act);
|
// System.out.println("Already pending " + act);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
/*for(int i = 0; i < act.maskActions.length; i++){
|
||||||
|
if(a.getClass().isAssignableFrom(a.maskActions[i].getClass())) return true;
|
||||||
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -94,6 +110,7 @@ public abstract class NetworkHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addToPending(NetworkAction a) {
|
public void addToPending(NetworkAction a) {
|
||||||
|
a.registerEndListener();
|
||||||
pendingActions.add(a);
|
pendingActions.add(a);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.emamaker.amazeing.AMazeIng;
|
||||||
import com.emamaker.amazeing.manager.network.GameClient;
|
import com.emamaker.amazeing.manager.network.GameClient;
|
||||||
import com.emamaker.amazeing.manager.network.GameServer;
|
import com.emamaker.amazeing.manager.network.GameServer;
|
||||||
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
||||||
|
import com.emamaker.amazeing.utils.MathUtils.Constants;
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
import com.esotericsoftware.kryonet.Connection;
|
||||||
import com.esotericsoftware.kryonet.Listener;
|
import com.esotericsoftware.kryonet.Listener;
|
||||||
|
|
||||||
|
@ -36,12 +37,14 @@ public abstract class NetworkAction {
|
||||||
protected NetworkHandler parent;
|
protected NetworkHandler parent;
|
||||||
protected boolean oneTime;
|
protected boolean oneTime;
|
||||||
|
|
||||||
protected long TIMEOUT_TIME = 5000;
|
|
||||||
protected long startTime;
|
protected long startTime;
|
||||||
boolean tookTimeout = false;
|
boolean tookTimeout = false;
|
||||||
boolean usingTimeout = true;
|
boolean usingTimeout = true;
|
||||||
boolean oneAtTheTime = true;
|
boolean oneAtTheTime = true;
|
||||||
|
|
||||||
|
//A list of actions that prevent the action to be started inside alreadyPending method
|
||||||
|
//(e.g NACLoginAO cannot be started if there's still a NACLoginAO2 running)
|
||||||
|
|
||||||
public AMazeIng main = AMazeIng.getMain();
|
public AMazeIng main = AMazeIng.getMain();
|
||||||
|
|
||||||
Listener startListener = new Listener() {
|
Listener startListener = new Listener() {
|
||||||
|
@ -74,13 +77,9 @@ public abstract class NetworkAction {
|
||||||
this.parent = parent_;
|
this.parent = parent_;
|
||||||
this.oneTime = oneTime;
|
this.oneTime = oneTime;
|
||||||
|
|
||||||
if (client() != null)
|
|
||||||
client().client.addListener(endListener);
|
|
||||||
if (server() != null)
|
|
||||||
server().server.addListener(endListener);
|
|
||||||
|
|
||||||
tookTimeout = false;
|
tookTimeout = false;
|
||||||
usingTimeout = true;
|
usingTimeout = true;
|
||||||
|
// setMaskActions(maskActions);
|
||||||
// update();
|
// update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,6 +95,8 @@ public abstract class NetworkAction {
|
||||||
client().client.addListener(startListener);
|
client().client.addListener(startListener);
|
||||||
if (server() != null)
|
if (server() != null)
|
||||||
server().server.addListener(startListener);
|
server().server.addListener(startListener);
|
||||||
|
|
||||||
|
// setMaskActions(maskActions_);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startAction() {
|
public void startAction() {
|
||||||
|
@ -110,6 +111,8 @@ public abstract class NetworkAction {
|
||||||
if (oneAtTheTime) {
|
if (oneAtTheTime) {
|
||||||
if (!parent.alreadyPending(this))
|
if (!parent.alreadyPending(this))
|
||||||
parent.addToPending(newInstance());
|
parent.addToPending(newInstance());
|
||||||
|
// else
|
||||||
|
// addToQueue();
|
||||||
} else {
|
} else {
|
||||||
parent.addToPending(newInstance());
|
parent.addToPending(newInstance());
|
||||||
}
|
}
|
||||||
|
@ -123,7 +126,7 @@ public abstract class NetworkAction {
|
||||||
resolveAction();
|
resolveAction();
|
||||||
if (oneTime)
|
if (oneTime)
|
||||||
responseReceived(null, null);
|
responseReceived(null, null);
|
||||||
if (System.currentTimeMillis() - startTime > TIMEOUT_TIME && usingTimeout)
|
if (System.currentTimeMillis() - startTime > Constants.NETWORK_ACTION_TIMEOUT_MILLIS && usingTimeout)
|
||||||
detachFromParent();
|
detachFromParent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,4 +186,12 @@ public abstract class NetworkAction {
|
||||||
parent.todoActions.add(newInstance());
|
parent.todoActions.add(newInstance());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void registerEndListener() {
|
||||||
|
if (client() != null)
|
||||||
|
client().client.addListener(endListener);
|
||||||
|
if (server() != null)
|
||||||
|
server().server.addListener(endListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,6 +12,9 @@ import com.esotericsoftware.kryonet.Connection;
|
||||||
|
|
||||||
public class NACGameStatusUpdate extends NetworkAction {
|
public class NACGameStatusUpdate extends NetworkAction {
|
||||||
|
|
||||||
|
public static boolean gotMessage = false;
|
||||||
|
public static long lastMsgTime = 0;
|
||||||
|
|
||||||
protected NACGameStatusUpdate(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
protected NACGameStatusUpdate(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
||||||
Object endPacket_, boolean oneTime) {
|
Object endPacket_, boolean oneTime) {
|
||||||
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
||||||
|
@ -51,6 +54,9 @@ public class NACGameStatusUpdate extends NetworkAction {
|
||||||
client().gameManager.gameStarted = ((GameStatusUpdate) incomingMsg).gameStarted;
|
client().gameManager.gameStarted = ((GameStatusUpdate) incomingMsg).gameStarted;
|
||||||
client().gameManager.anyoneWon = ((GameStatusUpdate) incomingMsg).anyoneWon;
|
client().gameManager.anyoneWon = ((GameStatusUpdate) incomingMsg).anyoneWon;
|
||||||
|
|
||||||
|
gotMessage = true;
|
||||||
|
lastMsgTime = System.currentTimeMillis();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.emamaker.amazeing.manager.network.action.actions.client.game;
|
|
||||||
|
|
||||||
import com.emamaker.amazeing.manager.network.NetworkCommon;
|
|
||||||
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
|
||||||
|
|
||||||
public class NACServerClosed extends NetworkAction {
|
|
||||||
|
|
||||||
protected NACServerClosed(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
|
||||||
Object endPacket_, boolean oneTime) {
|
|
||||||
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NACServerClosed(NetworkHandler parent_) {
|
|
||||||
super(parent_, new NetworkCommon.ServerClosed(), null, null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolveAction() {
|
|
||||||
super.resolveAction();
|
|
||||||
|
|
||||||
System.out.println("Server stopped!");
|
|
||||||
parent.stop();
|
|
||||||
main.uiManager.srvJoinScreen.showErrorDlg(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void responseReceived(Connection conn, Object msg) {
|
|
||||||
super.responseReceived(conn, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkAction newInstance() {
|
|
||||||
return new NACServerClosed(client(), incomingConnection, incomingMsg, responsePacket, endPacket, oneTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -43,7 +43,7 @@ public class NACRemovePlayer extends NetworkAction {
|
||||||
@Override
|
@Override
|
||||||
public void resolveAction() {
|
public void resolveAction() {
|
||||||
super.resolveAction();
|
super.resolveAction();
|
||||||
System.out.println("Asking the server to remove player " + uuid);
|
// System.out.println("Asking the server to remove player " + uuid);
|
||||||
((RemovePlayer) responsePacket).uuid = uuid;
|
((RemovePlayer) responsePacket).uuid = uuid;
|
||||||
client().client.sendUDP(responsePacket);
|
client().client.sendUDP(responsePacket);
|
||||||
}
|
}
|
||||||
|
@ -63,7 +63,7 @@ public class NACRemovePlayer extends NetworkAction {
|
||||||
}
|
}
|
||||||
detachFromParent();
|
detachFromParent();
|
||||||
}
|
}
|
||||||
// System.out.println("Response received for " + this);
|
System.out.println("Response received for " + this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -4,10 +4,13 @@ import com.emamaker.amazeing.manager.network.NetworkCommon;
|
||||||
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
||||||
import com.emamaker.amazeing.player.MazePlayerLocal;
|
import com.emamaker.amazeing.player.MazePlayerLocal;
|
||||||
|
import com.emamaker.amazeing.utils.MathUtils.Constants;
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
import com.esotericsoftware.kryonet.Connection;
|
||||||
|
|
||||||
public class NACUpdatePlayersPos extends NetworkAction {
|
public class NACUpdatePlayersPos extends NetworkAction {
|
||||||
|
|
||||||
|
long lastTime = 0;
|
||||||
|
|
||||||
protected NACUpdatePlayersPos(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
protected NACUpdatePlayersPos(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
||||||
Object endPacket_, boolean oneTime) {
|
Object endPacket_, boolean oneTime) {
|
||||||
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
||||||
|
@ -24,9 +27,13 @@ public class NACUpdatePlayersPos extends NetworkAction {
|
||||||
|
|
||||||
if (parent.gameManager.gameStarted)
|
if (parent.gameManager.gameStarted)
|
||||||
for (String s : client().localPlayers) {
|
for (String s : client().localPlayers) {
|
||||||
if (parent.players.containsKey(s) && ((MazePlayerLocal) parent.players.get(s)).getPressed()) {
|
// Update pos if the player moved or every sec
|
||||||
|
if (parent.players.containsKey(s) && (((MazePlayerLocal) parent.players.get(s)).getPressed()
|
||||||
|
|| System.currentTimeMillis() - lastTime > Constants.CLIENT_POS_PERIODIC_UPDATE)) {
|
||||||
responsePacket = parent.updatePlayer(s, parent.players.get(s), false);
|
responsePacket = parent.updatePlayer(s, parent.players.get(s), false);
|
||||||
client().client.sendUDP(responsePacket);
|
client().client.sendUDP(responsePacket);
|
||||||
|
if (System.currentTimeMillis() - lastTime > Constants.CLIENT_POS_PERIODIC_UPDATE)
|
||||||
|
lastTime = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
package com.emamaker.amazeing.manager.network.action.actions.server.game;
|
|
||||||
|
|
||||||
import com.emamaker.amazeing.manager.network.NetworkCommon;
|
|
||||||
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
|
||||||
import com.esotericsoftware.kryonet.Connection;
|
|
||||||
|
|
||||||
public class NASServerClosed extends NetworkAction {
|
|
||||||
|
|
||||||
protected NASServerClosed(NetworkHandler parent, Connection c, Object incomingMsg_, Object responsePacket_,
|
|
||||||
Object endPacket_, boolean oneTime) {
|
|
||||||
super(parent, c, incomingMsg_, responsePacket_, endPacket_, oneTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
public NASServerClosed(NetworkHandler parent_) {
|
|
||||||
super(parent_, null, new NetworkCommon.ServerClosed(), null, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void resolveAction() {
|
|
||||||
super.resolveAction();
|
|
||||||
System.out.println("Server stopped?");
|
|
||||||
server().server.sendToAllUDP(responsePacket);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void responseReceived(Connection conn, Object msg) {
|
|
||||||
super.responseReceived(conn, msg);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public NetworkAction newInstance() {
|
|
||||||
return new NASServerClosed(server(), incomingConnection, incomingMsg, responsePacket, endPacket, oneTime);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -30,6 +30,8 @@ public class NASLoginAO2 extends NetworkAction {
|
||||||
System.out.println("Client accepted uuid " + uuid);
|
System.out.println("Client accepted uuid " + uuid);
|
||||||
MazePlayerRemote player = new MazePlayerRemote(uuid);
|
MazePlayerRemote player = new MazePlayerRemote(uuid);
|
||||||
server().players.put(uuid, player);
|
server().players.put(uuid, player);
|
||||||
|
server().players.get(uuid).LAST_NETWORK_TIME = System.currentTimeMillis();
|
||||||
|
|
||||||
server().setUpdatePos(uuid, false);
|
server().setUpdatePos(uuid, false);
|
||||||
}
|
}
|
||||||
((ServerLoginAO2)responsePacket).uuid = uuid;
|
((ServerLoginAO2)responsePacket).uuid = uuid;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.emamaker.amazeing.manager.network.action.actions.server.login;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
|
||||||
import com.emamaker.amazeing.manager.network.NetworkCommon;
|
import com.emamaker.amazeing.manager.network.NetworkCommon;
|
||||||
|
import com.emamaker.amazeing.manager.network.NetworkCommon.ClientLoginAO2;
|
||||||
import com.emamaker.amazeing.manager.network.NetworkCommon.ServerLoginUUID;
|
import com.emamaker.amazeing.manager.network.NetworkCommon.ServerLoginUUID;
|
||||||
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
import com.emamaker.amazeing.manager.network.NetworkHandler;
|
||||||
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
import com.emamaker.amazeing.manager.network.action.NetworkAction;
|
||||||
|
|
|
@ -27,6 +27,7 @@ public class NASUpdatePlayerPos extends NetworkAction {
|
||||||
float pz = ((UpdatePlayerPosition) incomingMsg).pz;
|
float pz = ((UpdatePlayerPosition) incomingMsg).pz;
|
||||||
if (parent.players.containsKey(uuid) && server().canUpdatePos(uuid) && parent.gameManager.gameStarted) {
|
if (parent.players.containsKey(uuid) && server().canUpdatePos(uuid) && parent.gameManager.gameStarted) {
|
||||||
parent.players.get(uuid).setPos(px, py, pz);
|
parent.players.get(uuid).setPos(px, py, pz);
|
||||||
|
parent.players.get(uuid).LAST_NETWORK_TIME = System.currentTimeMillis();
|
||||||
server().server.sendToAllUDP(incomingMsg);
|
server().server.sendToAllUDP(incomingMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,9 +242,12 @@ public class MazeGenerator {
|
||||||
OLDMAZEX = MazeSettings.MAZEX;
|
OLDMAZEX = MazeSettings.MAZEX;
|
||||||
OLDMAZEZ = MazeSettings.MAZEZ;
|
OLDMAZEZ = MazeSettings.MAZEZ;
|
||||||
|
|
||||||
|
todraw = new int[w][h];
|
||||||
|
|
||||||
for (int j = 0; j < h; j++) {
|
for (int j = 0; j < h; j++) {
|
||||||
for (int i = 0; i < w; i++) {
|
for (int i = 0; i < w; i++) {
|
||||||
todraw[i][j] = todraw_[i][j];
|
todraw[i][j] = todraw_[i][j];
|
||||||
|
|
||||||
main.world.worldManager.setCell(i, 0, j, CellId.ID_GRASS);
|
main.world.worldManager.setCell(i, 0, j, CellId.ID_GRASS);
|
||||||
|
|
||||||
if (todraw[i][j] == 1)
|
if (todraw[i][j] == 1)
|
||||||
|
@ -260,17 +263,15 @@ public class MazeGenerator {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int[][] changeMap(int[][] tmp, int x, int z, int type) {
|
public int[][] changeMap(int[][] tmp, int x, int z, int type) {
|
||||||
if(x > 0 && x < w - 1 && z > 0 && z < h - 1 && todraw[x][z] != 2) tmp[x][z] = type;
|
if (x > 0 && x < w - 1 && z > 0 && z < h - 1 && todraw[x][z] != 2) {
|
||||||
|
tmp[x][z] = type;
|
||||||
|
}
|
||||||
return tmp;
|
return tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void requestChangeToMap(int[][] todraw_) {
|
public void requestChangeToMap(int[][] todraw_) {
|
||||||
if(AMazeIng.getMain().client.isRunning()) {
|
|
||||||
// AMazeIng.getMain().client.requestUpdateMap(todraw_);
|
|
||||||
}else {
|
|
||||||
show(todraw_);
|
show(todraw_);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
boolean allCellsVisited() {
|
boolean allCellsVisited() {
|
||||||
for (int i = 0; i < W; i++) {
|
for (int i = 0; i < W; i++) {
|
||||||
|
|
|
@ -142,4 +142,17 @@ public class MazeSetting {
|
||||||
return options[currentOption];
|
return options[currentOption];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getValueAt(int i) {
|
||||||
|
if(i < options.length) return options[i];
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getFirstValue() {
|
||||||
|
return getValueAt(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getLastValue() {
|
||||||
|
return getValueAt(options.length-1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ public class MazeSettings {
|
||||||
AMazeIng.getMain().uiManager);
|
AMazeIng.getMain().uiManager);
|
||||||
|
|
||||||
setStartPowerups = new MazeSettingStartPowerUps("POWERUPS AT START : ",
|
setStartPowerups = new MazeSettingStartPowerUps("POWERUPS AT START : ",
|
||||||
new String[] { "1", "2", "3", "4", "5", "8", "10", "15" }, 2, AMazeIng.getMain().uiManager);
|
new String[] { "1", "2", "3", "4", "5", "8", "10", "15" }, 6, AMazeIng.getMain().uiManager);
|
||||||
|
|
||||||
setEpDist = new MazeSettingEPDIST("END POINT DISTANCE:", new String[] { "1", "2", "5", "10", "20" }, 2,
|
setEpDist = new MazeSettingEPDIST("END POINT DISTANCE:", new String[] { "1", "2", "5", "10", "20" }, 2,
|
||||||
AMazeIng.getMain().uiManager);
|
AMazeIng.getMain().uiManager);
|
||||||
|
|
|
@ -48,6 +48,8 @@ public abstract class MazePlayer implements Disposable {
|
||||||
public float speed;
|
public float speed;
|
||||||
public float turnSpeed;
|
public float turnSpeed;
|
||||||
|
|
||||||
|
public long LAST_NETWORK_TIME = 0;
|
||||||
|
|
||||||
Vector3 pos = new Vector3();
|
Vector3 pos = new Vector3();
|
||||||
Quaternion rot = new Quaternion();
|
Quaternion rot = new Quaternion();
|
||||||
|
|
||||||
|
@ -146,7 +148,7 @@ public abstract class MazePlayer implements Disposable {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void usePowerUp() {
|
public void usePowerUp() {
|
||||||
if (currentPowerUp != null && !currentPowerUp.beingUsed)
|
if (currentPowerUp != null)
|
||||||
if (currentPowerUp.usePowerUp(this))
|
if (currentPowerUp.usePowerUp(this))
|
||||||
disablePowerUp();
|
disablePowerUp();
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,6 @@ public class MazePlayerLocal extends MazePlayer {
|
||||||
if (!isDisposed() && initedPhysics) {
|
if (!isDisposed() && initedPhysics) {
|
||||||
characterTransform.set(x, y, z, i, j, k, l);
|
characterTransform.set(x, y, z, i, j, k, l);
|
||||||
ghostObject.setWorldTransform(characterTransform);
|
ghostObject.setWorldTransform(characterTransform);
|
||||||
System.out.println(characterTransform.getTranslation(new Vector3()).toString());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,12 @@
|
||||||
package com.emamaker.amazeing.player.powerups;
|
package com.emamaker.amazeing.player.powerups;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.GL20;
|
import com.badlogic.gdx.graphics.GL20;
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.badlogic.gdx.graphics.VertexAttributes;
|
import com.badlogic.gdx.graphics.VertexAttributes;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.ParticleEffect;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool;
|
||||||
|
import com.badlogic.gdx.graphics.g2d.ParticleEffectPool.PooledEffect;
|
||||||
import com.badlogic.gdx.graphics.g3d.Environment;
|
import com.badlogic.gdx.graphics.g3d.Environment;
|
||||||
import com.badlogic.gdx.graphics.g3d.Material;
|
import com.badlogic.gdx.graphics.g3d.Material;
|
||||||
import com.badlogic.gdx.graphics.g3d.Model;
|
import com.badlogic.gdx.graphics.g3d.Model;
|
||||||
|
@ -16,6 +20,7 @@ import com.badlogic.gdx.math.Vector3;
|
||||||
import com.badlogic.gdx.utils.Disposable;
|
import com.badlogic.gdx.utils.Disposable;
|
||||||
import com.emamaker.amazeing.AMazeIng;
|
import com.emamaker.amazeing.AMazeIng;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
|
import com.emamaker.amazeing.utils.MathUtils;
|
||||||
|
|
||||||
public class PowerUp implements Disposable {
|
public class PowerUp implements Disposable {
|
||||||
|
|
||||||
|
@ -36,11 +41,15 @@ public class PowerUp implements Disposable {
|
||||||
|
|
||||||
Vector3 pos = new Vector3();
|
Vector3 pos = new Vector3();
|
||||||
|
|
||||||
public PowerUp(String name_, Texture texture_, boolean cont) {
|
ParticleEffect effect;
|
||||||
this(name_, texture_, cont, 1, 1);
|
ParticleEffectPool effectPool;
|
||||||
|
|
||||||
|
public PowerUp(String name_, Texture texture_, boolean cont, FileHandle effectFile, FileHandle imageSrc) {
|
||||||
|
this(name_, texture_, cont, 1, 1, effectFile, imageSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerUp(String name_, Texture texture_, boolean cont, float scaleX, float scaleZ) {
|
public PowerUp(String name_, Texture texture_, boolean cont, float scaleX, float scaleZ, FileHandle effectFile,
|
||||||
|
FileHandle imageSrc) {
|
||||||
this.name = name_;
|
this.name = name_;
|
||||||
this.texture = texture_;
|
this.texture = texture_;
|
||||||
this.scaleX = scaleX;
|
this.scaleX = scaleX;
|
||||||
|
@ -54,6 +63,12 @@ public class PowerUp implements Disposable {
|
||||||
beingUsed = false;
|
beingUsed = false;
|
||||||
built = false;
|
built = false;
|
||||||
toUpdatePos = false;
|
toUpdatePos = false;
|
||||||
|
|
||||||
|
if (effectFile != null && imageSrc != null) {
|
||||||
|
effect = new ParticleEffect();
|
||||||
|
effect.load(effectFile, imageSrc);
|
||||||
|
effectPool = new ParticleEffectPool(effect, 1, 2);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
|
@ -106,7 +121,15 @@ public class PowerUp implements Disposable {
|
||||||
|
|
||||||
// Return true if the effect has been resolved
|
// Return true if the effect has been resolved
|
||||||
public boolean usePowerUp(MazePlayer player) {
|
public boolean usePowerUp(MazePlayer player) {
|
||||||
// System.out.println(this.name + "!");
|
System.out.println(this.name + " ! ");
|
||||||
|
|
||||||
|
if (effect != null) {
|
||||||
|
PooledEffect e = effectPool.obtain();
|
||||||
|
Vector3 pos = MathUtils.toScreenCoords(player.getPos());
|
||||||
|
e.setPosition(pos.x, pos.y);
|
||||||
|
|
||||||
|
AMazeIng.getMain().effects.add(e);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -122,36 +145,47 @@ class PowerUpTemporized extends PowerUp {
|
||||||
long time = 0, startTime = 0;
|
long time = 0, startTime = 0;
|
||||||
boolean used = false;
|
boolean used = false;
|
||||||
|
|
||||||
public PowerUpTemporized(String name_, Texture texture_, boolean cont, float secs_) {
|
public PowerUpTemporized(String name_, Texture texture_, boolean cont, float secs_, FileHandle effectFile,
|
||||||
this(name_, texture_, cont, secs_, 1, 1);
|
FileHandle imageSrc) {
|
||||||
|
this(name_, texture_, cont, secs_, 1, 1, effectFile, imageSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerUpTemporized(String name_, Texture texture_, boolean cont, float secs_, float scaleX, float scaleZ) {
|
public PowerUpTemporized(String name_, Texture texture_, boolean cont, float secs_, float scaleX, float scaleZ,
|
||||||
super(name_, texture_, cont, scaleX, scaleZ);
|
FileHandle effectFile, FileHandle imageSrc) {
|
||||||
|
super(name_, texture_, cont, scaleX, scaleZ, effectFile, imageSrc);
|
||||||
this.time = (long) (secs_ * 1000);
|
this.time = (long) (secs_ * 1000);
|
||||||
startTime = 0;
|
startTime = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PooledEffect e;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean usePowerUp(MazePlayer player) {
|
public boolean usePowerUp(MazePlayer player) {
|
||||||
super.usePowerUp(player);
|
|
||||||
|
|
||||||
if (!used) {
|
if (!used) {
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
used = true;
|
used = true;
|
||||||
|
|
||||||
|
e = effectPool.obtain();
|
||||||
|
AMazeIng.getMain().effects.add(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (System.currentTimeMillis() - startTime < time) {
|
if (System.currentTimeMillis() - startTime <= time) {
|
||||||
temporizedEffect(player);
|
temporizedEffect(player);
|
||||||
|
System.out.println("starting " + name);
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
used = false;
|
used = false;
|
||||||
|
System.out.println("finishing " + name);
|
||||||
|
e = null;
|
||||||
temporizedEffectExpired(player);
|
temporizedEffectExpired(player);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void temporizedEffect(MazePlayer player) {
|
public void temporizedEffect(MazePlayer player) {
|
||||||
|
Vector3 p = MathUtils.toScreenCoords(player.getPos());
|
||||||
|
e.setPosition(p.x, p.y);
|
||||||
|
|
||||||
beingUsed = true;
|
beingUsed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,24 +200,26 @@ class PowerUpGiver extends PowerUp {
|
||||||
PowerUp powerup;
|
PowerUp powerup;
|
||||||
MazePlayer p;
|
MazePlayer p;
|
||||||
|
|
||||||
public PowerUpGiver(PowerUp p, String name, Texture texture, boolean continuos) {
|
public PowerUpGiver(PowerUp p, String name, Texture texture, boolean continuos, FileHandle effectFile,
|
||||||
this(p, name, texture, continuos, 1f, 1f);
|
FileHandle imageSrc) {
|
||||||
|
this(p, name, texture, continuos, 1f, 1f, effectFile, imageSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerUpGiver(PowerUp p, String name, Texture texture, boolean continuos, float scaleX, float scaleZ) {
|
public PowerUpGiver(PowerUp p, String name, Texture texture, boolean continuos, float scaleX, float scaleZ,
|
||||||
super(name, texture, continuos, scaleX, scaleZ);
|
FileHandle effectFile, FileHandle imageSrc) {
|
||||||
|
super(name, texture, continuos, scaleX, scaleZ, effectFile, imageSrc);
|
||||||
this.powerup = p;
|
this.powerup = p;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean usePowerUp(MazePlayer player) {
|
public boolean usePowerUp(MazePlayer player) {
|
||||||
super.usePowerUp(player);
|
// super.usePowerUp(player);
|
||||||
|
|
||||||
p = null;
|
p = null;
|
||||||
if (AMazeIng.getMain().currentGameManager.players.size() > 1) {
|
if (AMazeIng.getMain().currentGameManager.players.size() > 1) {
|
||||||
while (p == player || p == null)
|
while (p == player || p == null)
|
||||||
p = AMazeIng.getMain().currentGameManager.getRandomPlayer();
|
p = AMazeIng.getMain().currentGameManager.getRandomPlayer();
|
||||||
p.currentPowerUp = new PowerUpBallAndChain();
|
p.currentPowerUp = powerup;
|
||||||
p.usePowerUp();
|
p.usePowerUp();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,25 @@
|
||||||
package com.emamaker.amazeing.player.powerups;
|
package com.emamaker.amazeing.player.powerups;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
import com.emamaker.amazeing.utils.TextureLoader;
|
import com.emamaker.amazeing.utils.TextureLoader;
|
||||||
|
|
||||||
public class PowerUpBallAndChain extends PowerUpTemporized {
|
public class PowerUpBallAndChain extends PowerUpTemporized {
|
||||||
|
|
||||||
public PowerUpBallAndChain() {
|
public PowerUpBallAndChain() {
|
||||||
super("BALL AND CHAIN", TextureLoader.textureBallAndChain, true, 10, 1f, 1f);
|
super("BALL AND CHAIN", TextureLoader.textureBallAndChain, true, 10, 1f, 1f,
|
||||||
|
Gdx.files.internal("data/particles/ball_and_chain.particle"), Gdx.files.internal("data/powerups"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffect(MazePlayer player) {
|
public void temporizedEffect(MazePlayer player) {
|
||||||
|
super.temporizedEffect(player);
|
||||||
player.speedMult = 0.5f;
|
player.speedMult = 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffectExpired(MazePlayer player) {
|
public void temporizedEffectExpired(MazePlayer player) {
|
||||||
|
super.temporizedEffectExpired(player);
|
||||||
player.speedMult = 1f;
|
player.speedMult = 1f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,9 +27,7 @@ public class PowerUpBallAndChain extends PowerUpTemporized {
|
||||||
class PowerUpGiveBallAndChain extends PowerUpGiver {
|
class PowerUpGiveBallAndChain extends PowerUpGiver {
|
||||||
|
|
||||||
public PowerUpGiveBallAndChain() {
|
public PowerUpGiveBallAndChain() {
|
||||||
super(new PowerUpBallAndChain(), "BALL AND CHAIN GIVER",
|
super(new PowerUpBallAndChain(), "BALL AND CHAIN GIVER", TextureLoader.textureBallAndChain, false, null, null);
|
||||||
TextureLoader.textureBallAndChain, false,
|
|
||||||
1f, 1f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
package com.emamaker.amazeing.player.powerups;
|
package com.emamaker.amazeing.player.powerups;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
|
import com.badlogic.gdx.files.FileHandle;
|
||||||
import com.badlogic.gdx.graphics.Texture;
|
import com.badlogic.gdx.graphics.Texture;
|
||||||
import com.emamaker.amazeing.AMazeIng;
|
import com.emamaker.amazeing.AMazeIng;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
|
@ -12,11 +14,11 @@ public class PowerUpBomb extends PowerUp {
|
||||||
AMazeIng main = AMazeIng.getMain();
|
AMazeIng main = AMazeIng.getMain();
|
||||||
|
|
||||||
public PowerUpBomb() {
|
public PowerUpBomb() {
|
||||||
this("BOMB", TextureLoader.textureBomb, false, 1f, 1f);
|
this("BOMB", TextureLoader.textureBomb, false, 1f, 1f, Gdx.files.internal("data/particles/explosion_small.particle"), Gdx.files.internal("data/particles"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public PowerUpBomb(String name, Texture texture, boolean cont, float sx, float sz) {
|
public PowerUpBomb(String name, Texture texture, boolean cont, float sx, float sz, FileHandle effectFile, FileHandle imageSrc) {
|
||||||
super(name, texture, cont, sx, sz);
|
super(name, texture, cont, sx, sz, effectFile, imageSrc);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -26,6 +28,8 @@ public class PowerUpBomb extends PowerUp {
|
||||||
int px = (int) player.getPos().x;
|
int px = (int) player.getPos().x;
|
||||||
int pz = (int) player.getPos().z;
|
int pz = (int) player.getPos().z;
|
||||||
|
|
||||||
|
System.out.println("Player in " + player.getPos());
|
||||||
|
|
||||||
int tmptodraw[][] = new int[main.currentGameManager.mazeGen.w][main.currentGameManager.mazeGen.h];
|
int tmptodraw[][] = new int[main.currentGameManager.mazeGen.w][main.currentGameManager.mazeGen.h];
|
||||||
|
|
||||||
for (int i = 0; i < main.currentGameManager.mazeGen.w; i++)
|
for (int i = 0; i < main.currentGameManager.mazeGen.w; i++)
|
||||||
|
@ -47,7 +51,7 @@ public class PowerUpBomb extends PowerUp {
|
||||||
class PowerUpBigBomb extends PowerUpBomb{
|
class PowerUpBigBomb extends PowerUpBomb{
|
||||||
|
|
||||||
public PowerUpBigBomb() {
|
public PowerUpBigBomb() {
|
||||||
super("BIG BOMB", TextureLoader.textureBomb, false, 1.5f, 1.5f);
|
super("BIG BOMB", TextureLoader.textureBomb, false, 1.5f, 1.5f, Gdx.files.internal("data/particles/explosion.particle"), Gdx.files.internal("data/particles"));
|
||||||
radius = 2;
|
radius = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.emamaker.amazeing.player.powerups;
|
package com.emamaker.amazeing.player.powerups;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
import com.emamaker.amazeing.utils.TextureLoader;
|
import com.emamaker.amazeing.utils.TextureLoader;
|
||||||
|
|
||||||
|
@ -7,16 +8,18 @@ public class PowerUpFeather extends PowerUpTemporized {
|
||||||
|
|
||||||
public PowerUpFeather() {
|
public PowerUpFeather() {
|
||||||
super("FEATHER", TextureLoader.textureFeather, true, 10,
|
super("FEATHER", TextureLoader.textureFeather, true, 10,
|
||||||
1f, 1f);
|
1f, 1f, Gdx.files.internal("data/particles/feather.particle"), Gdx.files.internal("data/powerups"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffect(MazePlayer player) {
|
public void temporizedEffect(MazePlayer player) {
|
||||||
|
super.temporizedEffect(player);
|
||||||
player.speedMult = 2f;
|
player.speedMult = 2f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffectExpired(MazePlayer player) {
|
public void temporizedEffectExpired(MazePlayer player) {
|
||||||
|
super.temporizedEffectExpired(player);
|
||||||
player.speedMult = 1f;
|
player.speedMult = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,22 +1,25 @@
|
||||||
package com.emamaker.amazeing.player.powerups;
|
package com.emamaker.amazeing.player.powerups;
|
||||||
|
|
||||||
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.emamaker.amazeing.player.MazePlayer;
|
import com.emamaker.amazeing.player.MazePlayer;
|
||||||
import com.emamaker.amazeing.utils.TextureLoader;
|
import com.emamaker.amazeing.utils.TextureLoader;
|
||||||
|
|
||||||
public class PowerUpSlug extends PowerUpTemporized {
|
public class PowerUpSlug extends PowerUpTemporized {
|
||||||
|
|
||||||
public PowerUpSlug() {
|
public PowerUpSlug() {
|
||||||
super("SLUG", TextureLoader.textureSlug, true, 20,
|
super("SLUG", TextureLoader.textureSlug, true, 15,
|
||||||
1.3f, 1.3f);
|
1.3f, 1.3f, Gdx.files.internal("data/particles/slugs.particle"), Gdx.files.internal("data/powerups"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffect(MazePlayer player) {
|
public void temporizedEffect(MazePlayer player) {
|
||||||
|
super.temporizedEffect(player);
|
||||||
player.speedMult = 0.25f;
|
player.speedMult = 0.25f;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void temporizedEffectExpired(MazePlayer player) {
|
public void temporizedEffectExpired(MazePlayer player) {
|
||||||
|
super.temporizedEffectExpired(player);
|
||||||
player.speedMult = 1f;
|
player.speedMult = 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -25,7 +28,7 @@ public class PowerUpSlug extends PowerUpTemporized {
|
||||||
class PowerUpGiveSlug extends PowerUpGiver {
|
class PowerUpGiveSlug extends PowerUpGiver {
|
||||||
|
|
||||||
public PowerUpGiveSlug() {
|
public PowerUpGiveSlug() {
|
||||||
super(new PowerUpSlug(), "SLUG GIVER", TextureLoader.textureSlug, false, 1f, 1f);
|
super(new PowerUpSlug(), "SLUG GIVER", TextureLoader.textureSlug, false, 1f, 1f, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class PreGameScreen extends MyScreen {
|
||||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||||
hide();
|
hide();
|
||||||
if (uiManager.main.client.isRunning()) {
|
if (uiManager.main.client.isRunning()) {
|
||||||
uiManager.main.client.stop();
|
uiManager.main.client.stop(true);
|
||||||
uiManager.main.setScreen(uiManager.srvJoinScreen);
|
uiManager.main.setScreen(uiManager.srvJoinScreen);
|
||||||
}
|
}
|
||||||
if (uiManager.main.server.isRunning()) {
|
if (uiManager.main.server.isRunning()) {
|
||||||
|
|
|
@ -78,9 +78,9 @@ public class ServerJoinScreen extends MyScreen {
|
||||||
/* ERROR DIALOG */
|
/* ERROR DIALOG */
|
||||||
errorDlg = new Dialog("Error in communicating with server", uiManager.skin);
|
errorDlg = new Dialog("Error in communicating with server", uiManager.skin);
|
||||||
errorDlgText = new Label("", uiManager.skin);
|
errorDlgText = new Label("", uiManager.skin);
|
||||||
errorDlg.text(helpDlgText);
|
errorDlg.text(errorDlgText);
|
||||||
errorDlgOkBtn = new TextButton("OK", uiManager.skin);
|
errorDlgOkBtn = new TextButton("OK", uiManager.skin);
|
||||||
errorDlg.button(helpDlgOkBtn);
|
errorDlg.button(errorDlgOkBtn);
|
||||||
errorDlg.addListener(new InputListener() {
|
errorDlg.addListener(new InputListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||||
|
@ -160,6 +160,11 @@ public class ServerJoinScreen extends MyScreen {
|
||||||
failDlgText.setFontScale(labScale*0.9f);
|
failDlgText.setFontScale(labScale*0.9f);
|
||||||
failDlgOkBtn.getLabel().setFontScale(labScale*0.9f);
|
failDlgOkBtn.getLabel().setFontScale(labScale*0.9f);
|
||||||
|
|
||||||
|
errorDlg.setSize(cw*0.7f, ch*0.2f);
|
||||||
|
errorDlg.setPosition((sw-failDlg.getWidth())/2, (sh-failDlg.getHeight())/2);
|
||||||
|
errorDlgText.setFontScale(labScale*0.9f);
|
||||||
|
errorDlgOkBtn.getLabel().setFontScale(labScale*0.9f);
|
||||||
|
|
||||||
instLab.setFontScale(labScale);
|
instLab.setFontScale(labScale);
|
||||||
srvIpL.setFontScale(labScale);
|
srvIpL.setFontScale(labScale);
|
||||||
backBtn.getLabel().setFontScale(labScale);
|
backBtn.getLabel().setFontScale(labScale);
|
||||||
|
|
|
@ -1,10 +1,35 @@
|
||||||
package com.emamaker.amazeing.utils;
|
package com.emamaker.amazeing.utils;
|
||||||
|
|
||||||
import com.badlogic.gdx.math.Vector3;
|
import com.badlogic.gdx.math.Vector3;
|
||||||
|
import com.emamaker.amazeing.AMazeIng;
|
||||||
|
|
||||||
public class MathUtils extends net.dermetfan.gdx.math.MathUtils {
|
public class MathUtils extends net.dermetfan.gdx.math.MathUtils {
|
||||||
|
|
||||||
public static float vectorDistance(Vector3 v1, Vector3 v2) {
|
public static float vectorDistance(Vector3 v1, Vector3 v2) {
|
||||||
return (float) Math.sqrt((v1.x - v2.x)*(v1.x - v2.x) + (v1.y - v2.y)*(v1.y - v2.y) + (v1.z - v2.z)*(v1.z - v2.z));
|
return (float) Math
|
||||||
|
.sqrt((v1.x - v2.x) * (v1.x - v2.x) + (v1.y - v2.y) * (v1.y - v2.y) + (v1.z - v2.z) * (v1.z - v2.z));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static Vector3 toScreenCoords(Vector3 vec) {
|
||||||
|
//This exta variable is needed otherwise the cam.project will convert the vector in argument from world coordinates to screen coordinates
|
||||||
|
Vector3 v1 = new Vector3(vec);
|
||||||
|
return AMazeIng.getMain().world.cam.project(v1);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long map(long x, long in_min, long in_max, long out_min, long out_max) {
|
||||||
|
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int map(int x, int in_min, int in_max, int out_min, int out_max) {
|
||||||
|
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Constants {
|
||||||
|
|
||||||
|
public static int NETWORK_ACTION_TIMEOUT_MILLIS = 7000;
|
||||||
|
public static int COMMUNICATION_TIMEOUT_MILLIS = 100000;
|
||||||
|
public static int CLIENT_POS_PERIODIC_UPDATE = 1000;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 59 KiB |
|
@ -2,10 +2,10 @@ apply plugin: "java"
|
||||||
|
|
||||||
sourceCompatibility = 1.7
|
sourceCompatibility = 1.7
|
||||||
sourceSets.main.java.srcDirs = [ "src/" ]
|
sourceSets.main.java.srcDirs = [ "src/" ]
|
||||||
sourceSets.main.resources.srcDirs = ["../android/assets"]
|
sourceSets.main.resources.srcDirs = ["../core/assets/"]
|
||||||
|
|
||||||
project.ext.mainClassName = "com.emamaker.amazeing.desktop.DesktopLauncher"
|
project.ext.mainClassName = "com.emamaker.amazeing.desktop.DesktopLauncher"
|
||||||
project.ext.assetsDir = new File("../android/assets")
|
project.ext.assetsDir = new File("../core/assets")
|
||||||
|
|
||||||
task run(dependsOn: classes, type: JavaExec) {
|
task run(dependsOn: classes, type: JavaExec) {
|
||||||
main = project.mainClassName
|
main = project.mainClassName
|
||||||
|
|
Loading…
Reference in New Issue