Pause menu, colored players & bug fixes
parent
40cc3ed7ed
commit
aa6a37f80e
|
@ -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
|
||||
|
Binary file not shown.
After Width: | Height: | Size: 678 B |
|
@ -5,8 +5,14 @@ import java.util.Random;
|
|||
import java.util.Set;
|
||||
|
||||
import com.badlogic.gdx.Game;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.badlogic.gdx.scenes.scene2d.InputEvent;
|
||||
import com.badlogic.gdx.scenes.scene2d.InputListener;
|
||||
import com.badlogic.gdx.scenes.scene2d.Stage;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Dialog;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Label;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
|
||||
import com.badlogic.gdx.utils.viewport.ScreenViewport;
|
||||
import com.emamaker.amazeing.AMazeIng;
|
||||
import com.emamaker.amazeing.AMazeIng.Platform;
|
||||
|
@ -16,6 +22,7 @@ import com.emamaker.amazeing.player.MazePlayer;
|
|||
import com.emamaker.amazeing.player.MazePlayerLocal;
|
||||
import com.emamaker.amazeing.player.powerups.PowerUp;
|
||||
import com.emamaker.amazeing.player.powerups.PowerUps;
|
||||
import com.emamaker.amazeing.utils.MathUtils;
|
||||
import com.emamaker.voxelengine.block.CellId;
|
||||
import com.emamaker.voxelengine.player.Player;
|
||||
|
||||
|
@ -40,6 +47,12 @@ public class GameManager {
|
|||
|
||||
PowerUp pup;
|
||||
|
||||
TextButton pauseBtn;
|
||||
Dialog pauseDlg;
|
||||
Label pauseDlgText;
|
||||
TextButton pauseDlgResumeBtn, pauseDlgQuitBtn;
|
||||
boolean showingDialog = false;
|
||||
|
||||
public GameManager(Game main_, GameType t) {
|
||||
main = (AMazeIng) main_;
|
||||
gameStarted = false;
|
||||
|
@ -54,7 +67,6 @@ public class GameManager {
|
|||
public void generateMaze(Set<MazePlayer> pl, int todraw[][]) {
|
||||
main.setScreen(null);
|
||||
|
||||
AMazeIng.getMain().multiplexer.removeProcessor(stage);
|
||||
AMazeIng.getMain().multiplexer.addProcessor(stage);
|
||||
|
||||
anyoneWon = false;
|
||||
|
@ -96,6 +108,8 @@ public class GameManager {
|
|||
resetCamera();
|
||||
gameStarted = true;
|
||||
|
||||
showingDialog = false;
|
||||
|
||||
}
|
||||
|
||||
public void addTouchScreenInput() {
|
||||
|
@ -109,11 +123,70 @@ public class GameManager {
|
|||
}
|
||||
}
|
||||
|
||||
public void setupHud() {
|
||||
pauseBtn = new TextButton("Pause", main.uiManager.skin);
|
||||
// pauseBtn.getStyle().imageUp = new TextureRegionDrawable(new TextureRegion(new Texture(Gdx.files.internal("data/pause.png"))));
|
||||
// pauseBtn.getStyle().imageDown = new TextureRegionDrawable(new TextureRegion(new Texture(Gdx.files.internal("data/pause.png"))));
|
||||
|
||||
pauseDlg = new Dialog("Pause", main.uiManager.skin);
|
||||
|
||||
pauseDlgText = new Label("What do you want to do?", main.uiManager.skin);
|
||||
|
||||
pauseDlgResumeBtn = new TextButton("Resume", main.uiManager.skin);
|
||||
pauseDlgQuitBtn = new TextButton("Quit", main.uiManager.skin);
|
||||
|
||||
pauseDlg.text(pauseDlgText);
|
||||
pauseDlg.button(pauseDlgQuitBtn);
|
||||
pauseDlg.button(pauseDlgResumeBtn);
|
||||
|
||||
pauseBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
pauseDlg.show(stage);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
pauseDlgResumeBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
pauseDlg.hide();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
pauseDlgQuitBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
quitGameByBtn();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
stage.addActor(pauseBtn);
|
||||
}
|
||||
|
||||
|
||||
float cw, ch, d, labScale, buttonDim;
|
||||
public void hudUpdate() {
|
||||
resetCamera();
|
||||
setCamera(new Vector3((MazeSettings.MAZEX + 1) / 2, (MazeSettings.MAZEX + MazeSettings.MAZEZ) * 0.45f,
|
||||
setCamera(new Vector3((MazeSettings.MAZEX + 1) / 2, (MazeSettings.MAZEX + MazeSettings.MAZEZ) * 0.48f,
|
||||
MazeSettings.MAZEZ / 2 - 1), new Vector3(0, -90, 0));
|
||||
|
||||
cw = Gdx.graphics.getWidth();
|
||||
ch = Gdx.graphics.getHeight();
|
||||
d = MathUtils.pythagoreanTheorem(cw, ch);
|
||||
labScale = d * .00090f;
|
||||
buttonDim = d * 0.04f;
|
||||
pauseBtn.setSize(buttonDim, buttonDim);
|
||||
pauseBtn.setPosition((cw - pauseBtn.getWidth()) / 2, ch - pauseBtn.getHeight());
|
||||
pauseBtn.getLabel().setFontScale(labScale*0.9f);
|
||||
|
||||
pauseDlg.setSize(cw*0.2f, ch*0.15f);
|
||||
pauseDlg.setPosition((cw-pauseDlg.getWidth())/2, (ch-pauseDlg.getHeight())/2);
|
||||
pauseDlgResumeBtn.getLabel().setFontScale(labScale*0.9f);
|
||||
pauseDlgQuitBtn.getLabel().setFontScale(labScale*0.9f);
|
||||
pauseDlgText.setFontScale(labScale*0.9f);
|
||||
|
||||
stage.act();
|
||||
stage.draw();
|
||||
}
|
||||
|
@ -182,11 +255,19 @@ public class GameManager {
|
|||
public void setFinished() {
|
||||
anyoneWon = true;
|
||||
gameStarted = false;
|
||||
|
||||
|
||||
AMazeIng.getMain().multiplexer.removeProcessor(stage);
|
||||
for (MazePlayer p : players)
|
||||
p.disablePowerUp();
|
||||
main.clearEffects();
|
||||
}
|
||||
|
||||
public void quitGameByBtn() {
|
||||
setFinished();
|
||||
if (pauseDlg != null) {
|
||||
pauseDlg.hide();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean getFinished() {
|
||||
return anyoneWon;
|
||||
|
@ -230,7 +311,7 @@ public class GameManager {
|
|||
do {
|
||||
x = (Math.abs(rand.nextInt() - 1) % (mazeGen.w));
|
||||
z = (Math.abs(rand.nextInt() - 1) % (mazeGen.h));
|
||||
} while (thereIsPlayerInPos(x, z) || mazeGen.occupiedSpot(x, z) || thereIsPowerUpInPos(x, z));
|
||||
} while (thereIsPlayerInPos(x, z) || mazeGen.occupiedSpot(x, z));
|
||||
System.out.println("Spawning power-up in " + x + ", " + z);
|
||||
spawnPowerUp(x + .5f, z + .5f);
|
||||
}
|
||||
|
@ -370,4 +451,5 @@ public class GameManager {
|
|||
p.dispose();
|
||||
players.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ public class GameManagerClient extends GameManager {
|
|||
|
||||
public GameManagerClient() {
|
||||
super(AMazeIng.getMain(), GameType.CLIENT);
|
||||
setupHud();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -26,7 +27,6 @@ public class GameManagerClient extends GameManager {
|
|||
super.inGameUpdate();
|
||||
|
||||
renderWorld();
|
||||
hudUpdate();
|
||||
|
||||
main.world.modelBatch.begin(main.world.cam);
|
||||
|
||||
|
@ -34,6 +34,8 @@ public class GameManagerClient extends GameManager {
|
|||
renderPowerUps();
|
||||
|
||||
main.world.modelBatch.end();
|
||||
|
||||
hudUpdate();
|
||||
}
|
||||
|
||||
boolean showed = false;
|
||||
|
@ -62,4 +64,13 @@ public class GameManagerClient extends GameManager {
|
|||
public void checkWin() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void quitGameByBtn() {
|
||||
super.quitGameByBtn();
|
||||
main.server.stop();
|
||||
main.client.stop();
|
||||
main.setScreen(main.uiManager.titleScreen);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ public class GameManagerLocal extends GameManager {
|
|||
|
||||
public GameManagerLocal() {
|
||||
super(AMazeIng.getMain(), GameType.LOCAL);
|
||||
setupHud();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -35,7 +36,6 @@ public class GameManagerLocal extends GameManager {
|
|||
assignPowerUps();
|
||||
|
||||
renderWorld();
|
||||
hudUpdate();
|
||||
|
||||
main.world.modelBatch.begin(main.world.cam);
|
||||
|
||||
|
@ -44,6 +44,8 @@ public class GameManagerLocal extends GameManager {
|
|||
|
||||
main.world.modelBatch.end();
|
||||
|
||||
hudUpdate();
|
||||
|
||||
}
|
||||
|
||||
boolean showed = false;
|
||||
|
@ -55,4 +57,5 @@ public class GameManagerLocal extends GameManager {
|
|||
showed = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -79,7 +79,7 @@ public class GameServer extends NetworkHandler {
|
|||
players.get(s).dispose();
|
||||
players.remove(s);
|
||||
}
|
||||
System.out.println(Arrays.toString(players.values().toArray()));
|
||||
// System.out.println(Arrays.toString(players.values().toArray()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class MazeSettings {
|
|||
AMazeIng.getMain().uiManager);
|
||||
|
||||
setStartPowerups = new MazeSettingStartPowerUps("POWERUPS AT START : ",
|
||||
new String[] { "1", "2", "3", "4", "5", "8", "10", "15" }, 6, AMazeIng.getMain().uiManager);
|
||||
new String[] { "1", "2", "3", "4", "5", "8", "10", "15" }, 3, AMazeIng.getMain().uiManager);
|
||||
|
||||
setEpDist = new MazeSettingEPDIST("END POINT DISTANCE:", new String[] { "1", "2", "5", "10", "20" }, 2,
|
||||
AMazeIng.getMain().uiManager);
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.emamaker.amazeing.player;
|
||||
|
||||
import java.util.Random;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.GL20;
|
||||
import com.badlogic.gdx.graphics.VertexAttributes;
|
||||
import com.badlogic.gdx.graphics.g3d.Environment;
|
||||
|
@ -7,6 +11,7 @@ import com.badlogic.gdx.graphics.g3d.Material;
|
|||
import com.badlogic.gdx.graphics.g3d.Model;
|
||||
import com.badlogic.gdx.graphics.g3d.ModelBatch;
|
||||
import com.badlogic.gdx.graphics.g3d.ModelInstance;
|
||||
import com.badlogic.gdx.graphics.g3d.attributes.ColorAttribute;
|
||||
import com.badlogic.gdx.graphics.g3d.model.Node;
|
||||
import com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder;
|
||||
import com.badlogic.gdx.graphics.g3d.utils.ModelBuilder;
|
||||
|
@ -15,10 +20,9 @@ import com.badlogic.gdx.math.Vector3;
|
|||
import com.badlogic.gdx.utils.Disposable;
|
||||
import com.emamaker.amazeing.AMazeIng;
|
||||
import com.emamaker.amazeing.player.powerups.PowerUp;
|
||||
import com.emamaker.amazeing.utils.MathUtils;
|
||||
import com.emamaker.voxelengine.physics.GameObject;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public abstract class MazePlayer implements Disposable {
|
||||
|
||||
AMazeIng main;
|
||||
|
@ -39,7 +43,7 @@ public abstract class MazePlayer implements Disposable {
|
|||
boolean initedPhysics = false;
|
||||
boolean toUpdatePos = false;
|
||||
|
||||
public String uuid;
|
||||
public String uuid = UUID.randomUUID().toString();;
|
||||
public PowerUp currentPowerUp;
|
||||
|
||||
public float baseSpeed = 3f;
|
||||
|
@ -49,9 +53,11 @@ public abstract class MazePlayer implements Disposable {
|
|||
public float turnSpeed;
|
||||
|
||||
public long LAST_NETWORK_TIME = 0;
|
||||
|
||||
|
||||
Vector3 pos = new Vector3();
|
||||
Quaternion rot = new Quaternion();
|
||||
|
||||
protected Color color = new Color(1f, 1f, 1f, 1f);
|
||||
|
||||
MazePlayer(boolean s) {
|
||||
this(String.valueOf((char) (65 + rand.nextInt(26))), s);
|
||||
|
@ -113,7 +119,11 @@ public abstract class MazePlayer implements Disposable {
|
|||
modelBuilder.begin();
|
||||
Node n = modelBuilder.node();
|
||||
n.id = "MazePlayer";
|
||||
modelBuilder.part("MazePlayer", GL20.GL_TRIANGLES, meshAttr, new Material()).box(0.6f, 0.6f, 0.6f);
|
||||
color = setColorByUUID();
|
||||
modelBuilder
|
||||
.part("MazePlayer", GL20.GL_TRIANGLES, meshAttr,
|
||||
new Material(ColorAttribute.createDiffuse(color)))
|
||||
.box(0.6f, 0.6f, 0.6f);
|
||||
mazePlayerModel = modelBuilder.end();
|
||||
instance = new ModelInstance(mazePlayerModel);
|
||||
}
|
||||
|
@ -169,4 +179,18 @@ public abstract class MazePlayer implements Disposable {
|
|||
public boolean isDisposed() {
|
||||
return disposed;
|
||||
}
|
||||
|
||||
public Color setColorByUUID() {
|
||||
return setColor(MathUtils.getRandomColor(uuid));
|
||||
}
|
||||
|
||||
public Color setColor(Color c) {
|
||||
color.set(c);
|
||||
return color;
|
||||
}
|
||||
|
||||
public Color getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -71,7 +71,6 @@ public class MazePlayerLocal extends MazePlayer {
|
|||
this.startx = startx;
|
||||
this.starty = starty;
|
||||
this.startz = startz;
|
||||
|
||||
}
|
||||
|
||||
public MazePlayerLocal(Controller ctrl_) {
|
||||
|
@ -93,7 +92,6 @@ public class MazePlayerLocal extends MazePlayer {
|
|||
this.startx = startx;
|
||||
this.starty = starty;
|
||||
this.startz = startz;
|
||||
|
||||
}
|
||||
|
||||
public MazePlayerLocal(Touchpad ctrl_, int p) {
|
||||
|
@ -279,13 +277,15 @@ public class MazePlayerLocal extends MazePlayer {
|
|||
@Override
|
||||
public void update() {
|
||||
super.update();
|
||||
if(initedPhysics && !isDisposed()) inputs();
|
||||
if (initedPhysics && !isDisposed())
|
||||
inputs();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void updateFromTmpPos() {
|
||||
super.updateFromTmpPos();
|
||||
if(initedPhysics && !isDisposed()) pos.set(ghostObject.getWorldTransform().getTranslation(new Vector3()));
|
||||
if (initedPhysics && !isDisposed())
|
||||
pos.set(ghostObject.getWorldTransform().getTranslation(new Vector3()));
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
@ -319,7 +319,7 @@ public class MazePlayerLocal extends MazePlayer {
|
|||
disposed = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean getPressed() {
|
||||
return pressed;
|
||||
}
|
||||
|
|
|
@ -171,11 +171,11 @@ class PowerUpTemporized extends PowerUp {
|
|||
|
||||
if (System.currentTimeMillis() - startTime <= time) {
|
||||
temporizedEffect(player);
|
||||
System.out.println("starting " + name);
|
||||
// System.out.println("starting " + name);
|
||||
return false;
|
||||
} else {
|
||||
used = false;
|
||||
System.out.println("finishing " + name);
|
||||
// System.out.println("finishing " + name);
|
||||
e = null;
|
||||
temporizedEffectExpired(player);
|
||||
return true;
|
||||
|
|
|
@ -22,201 +22,201 @@ import java.util.HashSet;
|
|||
|
||||
public class PlayerChooseScreen extends MyScreen {
|
||||
|
||||
Label[] labels;
|
||||
CheckBox[] buttons;
|
||||
int currentLabel = 0;
|
||||
ArrayList<MazePlayer> players = new ArrayList<MazePlayer>();
|
||||
Label[] labels;
|
||||
CheckBox[] buttons;
|
||||
int currentLabel = 0;
|
||||
ArrayList<MazePlayer> players = new ArrayList<MazePlayer>();
|
||||
|
||||
MyScreen thisScreen;
|
||||
MyScreen thisScreen;
|
||||
|
||||
Container<Table> firstRowContainer;
|
||||
Table firstRowTable;
|
||||
Container<Table> firstRowContainer;
|
||||
Table firstRowTable;
|
||||
|
||||
Label instLab, helpDlgText;
|
||||
TextButton backBtn, setBtn, helpBtn, playBtn, helpDlgOkBtn;
|
||||
Dialog helpDlg;
|
||||
Label instLab, helpDlgText;
|
||||
TextButton backBtn, setBtn, helpBtn, playBtn, helpDlgOkBtn;
|
||||
Dialog helpDlg;
|
||||
|
||||
int totalPlayers = 0;
|
||||
int totalPlayers = 0;
|
||||
|
||||
public PlayerChooseScreen(UIManager uiManager_) {
|
||||
super(uiManager_);
|
||||
public PlayerChooseScreen(UIManager uiManager_) {
|
||||
super(uiManager_);
|
||||
|
||||
chmult = 0.8f;
|
||||
}
|
||||
chmult = 0.8f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createTable() {
|
||||
super.createTable();
|
||||
thisScreen = this;
|
||||
@Override
|
||||
public void createTable() {
|
||||
super.createTable();
|
||||
thisScreen = this;
|
||||
|
||||
firstRowContainer = new Container<Table>();
|
||||
firstRowTable = new Table();
|
||||
firstRowContainer = new Container<Table>();
|
||||
firstRowTable = new Table();
|
||||
|
||||
firstRowContainer.setActor(firstRowTable);
|
||||
firstRowContainer.setActor(firstRowTable);
|
||||
|
||||
instLab = new Label(
|
||||
AMazeIng.PLATFORM == Platform.DESKTOP ? "Use WASD, ARROWS, or button on controller to join the match"
|
||||
: "Tap the buttons below to join the match",
|
||||
uiManager.skin);
|
||||
backBtn = new TextButton("<", uiManager.skin);
|
||||
setBtn = new TextButton("Settings", uiManager.skin);
|
||||
helpBtn = new TextButton("?", uiManager.skin);
|
||||
playBtn = new TextButton("Play!", uiManager.skin);
|
||||
/* HELP DIALOG */
|
||||
helpDlg = new Dialog("Help", uiManager.skin);
|
||||
instLab = new Label(
|
||||
AMazeIng.PLATFORM == Platform.DESKTOP ? "Use WASD, ARROWS, or button on controller to join the match"
|
||||
: "Tap the buttons below to join the match",
|
||||
uiManager.skin);
|
||||
backBtn = new TextButton("<", uiManager.skin);
|
||||
setBtn = new TextButton("Settings", uiManager.skin);
|
||||
helpBtn = new TextButton("?", uiManager.skin);
|
||||
playBtn = new TextButton("Play!", uiManager.skin);
|
||||
/* HELP DIALOG */
|
||||
helpDlg = new Dialog("Help", uiManager.skin);
|
||||
// helpDlg.setResizable(true);
|
||||
helpDlgText = new Label("Here you can start a singleplayer or multiplayer game on the local machine:\n"
|
||||
+ "For keyboard players, pressing W,A,S,D or the directional arrows will toggle two different players.\n"
|
||||
+ "Pressing a button on a controller will toggle a player.\n"
|
||||
+ "Mobile players can tap the buttons below to join the game.\n"
|
||||
+ "You can edit game settings from the \"Settings\" menu or use the \"<\" button to go back to the main menu\n"
|
||||
+ "Press the \"Play!\" button to start the game with the players that have currently joined.\n"
|
||||
+ "Once a game is finished you will go back to this menu", uiManager.skin);
|
||||
helpDlg.text(helpDlgText);
|
||||
helpDlgOkBtn = new TextButton("OK", uiManager.skin);
|
||||
helpDlg.button(helpDlgOkBtn);
|
||||
helpDlgOkBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
helpDlg.hide();
|
||||
helpDlgText = new Label("Here you can start a singleplayer or multiplayer game on the local machine:\n"
|
||||
+ "For keyboard players, pressing W,A,S,D or the directional arrows will toggle two different players.\n"
|
||||
+ "Pressing a button on a controller will toggle a player.\n"
|
||||
+ "Mobile players can tap the buttons below to join the game.\n"
|
||||
+ "You can edit game settings from the \"Settings\" menu or use the \"<\" button to go back to the main menu\n"
|
||||
+ "Press the \"Play!\" button to start the game with the players that have currently joined.\n"
|
||||
+ "Once a game is finished you will go back to this menu", uiManager.skin);
|
||||
helpDlg.text(helpDlgText);
|
||||
helpDlgOkBtn = new TextButton("OK", uiManager.skin);
|
||||
helpDlg.button(helpDlgOkBtn);
|
||||
helpDlgOkBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
helpDlg.hide();
|
||||
// hideDialog();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
// Add actions to the buttons
|
||||
backBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
hide();
|
||||
uiManager.main.setScreen(uiManager.titleScreen);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
playBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
if (AMazeIng.PLATFORM != Platform.DESKTOP) {
|
||||
for (MazePlayer p : players)
|
||||
p.dispose();
|
||||
players.clear();
|
||||
// Add actions to the buttons
|
||||
backBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
hide();
|
||||
uiManager.main.setScreen(uiManager.titleScreen);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
playBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
if (AMazeIng.PLATFORM != Platform.DESKTOP) {
|
||||
for (MazePlayer p : players)
|
||||
p.dispose();
|
||||
players.clear();
|
||||
|
||||
for (int i = 0; i < buttons.length; i++)
|
||||
if (buttons[i].isChecked())
|
||||
players.add(new MazePlayerLocal(new Touchpad(0f, uiManager.skin), i));
|
||||
}
|
||||
if (!players.isEmpty()) {
|
||||
uiManager.main.gameManager.generateMaze(new HashSet<>(players));
|
||||
}
|
||||
for (int i = 0; i < buttons.length; i++)
|
||||
if (buttons[i].isChecked())
|
||||
players.add(new MazePlayerLocal(new Touchpad(0f, uiManager.skin), i));
|
||||
}
|
||||
if (!players.isEmpty()) {
|
||||
uiManager.main.gameManager.generateMaze(new HashSet<>(players));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
});
|
||||
setBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
hide();
|
||||
uiManager.setScreen.setPrevScreen(thisScreen);
|
||||
uiManager.main.setScreen(uiManager.setScreen);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
helpBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
helpDlg.show(stage);
|
||||
buildTable();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
});
|
||||
setBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
hide();
|
||||
uiManager.setScreen.setPrevScreen(thisScreen);
|
||||
uiManager.main.setScreen(uiManager.setScreen);
|
||||
return true;
|
||||
}
|
||||
});
|
||||
helpBtn.addListener(new InputListener() {
|
||||
@Override
|
||||
public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) {
|
||||
helpDlg.show(stage);
|
||||
buildTable();
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildTable() {
|
||||
super.buildTable();
|
||||
firstRowTable.clear();
|
||||
@Override
|
||||
public void buildTable() {
|
||||
super.buildTable();
|
||||
firstRowTable.clear();
|
||||
|
||||
totalPlayers = 0;
|
||||
totalPlayers = 0;
|
||||
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
labels = new Label[MazeSettings.MAXPLAYERS];
|
||||
// Labels to know if players joined
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i] = new Label("-- empty slot --", uiManager.skin);
|
||||
}
|
||||
} else {
|
||||
buttons = new CheckBox[MazeSettings.MAXPLAYERS];
|
||||
// Labels to know if players joined
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i] = new CheckBox("-- empty slot --", uiManager.skin);
|
||||
}
|
||||
}
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
labels = new Label[MazeSettings.MAXPLAYERS];
|
||||
// Labels to know if players joined
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i] = new Label("-- empty slot --", uiManager.skin);
|
||||
}
|
||||
} else {
|
||||
buttons = new CheckBox[MazeSettings.MAXPLAYERS];
|
||||
// Labels to know if players joined
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i] = new CheckBox("-- empty slot --", uiManager.skin);
|
||||
}
|
||||
}
|
||||
|
||||
float d = containerDiagonal();
|
||||
float labScale = d * .00090f;
|
||||
float buttonDim = d * 0.05f;
|
||||
float d = containerDiagonal();
|
||||
float labScale = d * .00090f;
|
||||
float buttonDim = d * 0.05f;
|
||||
|
||||
firstRowContainer.setSize(cw, ch * 0.2f);
|
||||
firstRowContainer.setPosition(tableContainer.getX(), ch * 0.1f);
|
||||
firstRowContainer.fill();
|
||||
firstRowContainer.setSize(cw, ch * 0.2f);
|
||||
firstRowContainer.setPosition(tableContainer.getX(), ch * 0.1f);
|
||||
firstRowContainer.fill();
|
||||
|
||||
helpDlg.setSize(cw * 0.7f, ch * 0.3f);
|
||||
helpDlg.setPosition((sw - helpDlg.getWidth()) / 2, (sh - helpDlg.getHeight()) / 2);
|
||||
helpDlgText.setFontScale(labScale * 0.8f);
|
||||
helpDlgOkBtn.getLabel().setFontScale(labScale * 0.8f);
|
||||
helpDlg.setSize(cw * 0.7f, ch * 0.3f);
|
||||
helpDlg.setPosition((sw - helpDlg.getWidth()) / 2, (sh - helpDlg.getHeight()) / 2);
|
||||
helpDlgText.setFontScale(labScale * 0.8f);
|
||||
helpDlgOkBtn.getLabel().setFontScale(labScale * 0.8f);
|
||||
|
||||
instLab.setFontScale(labScale);
|
||||
backBtn.getLabel().setFontScale(labScale);
|
||||
setBtn.getLabel().setFontScale(labScale);
|
||||
helpBtn.getLabel().setFontScale(labScale);
|
||||
playBtn.getLabel().setFontScale(labScale);
|
||||
instLab.setFontScale(labScale);
|
||||
backBtn.getLabel().setFontScale(labScale);
|
||||
setBtn.getLabel().setFontScale(labScale);
|
||||
helpBtn.getLabel().setFontScale(labScale);
|
||||
playBtn.getLabel().setFontScale(labScale);
|
||||
|
||||
firstRowTable.add(backBtn).fillX().expandX().space(cw * 0.005f).width(buttonDim).height(buttonDim);
|
||||
firstRowTable.add(instLab).space(cw * 0.25f).width(cw / 2);
|
||||
firstRowTable.add(setBtn).fillX().expandX().space(cw * 0.005f).height(buttonDim);
|
||||
firstRowTable.add(helpBtn).fillX().expandX().space(cw * 0.005f).width(buttonDim).height(buttonDim);
|
||||
firstRowTable.add(backBtn).fillX().expandX().space(cw * 0.005f).width(buttonDim).height(buttonDim);
|
||||
firstRowTable.add(instLab).space(cw * 0.25f).width(cw / 2);
|
||||
firstRowTable.add(setBtn).fillX().expandX().space(cw * 0.005f).height(buttonDim);
|
||||
firstRowTable.add(helpBtn).fillX().expandX().space(cw * 0.005f).width(buttonDim).height(buttonDim);
|
||||
|
||||
table.row().colspan(MazeSettings.MAXPLAYERS == 2 ? 2 : 4);
|
||||
table.row().colspan(MazeSettings.MAXPLAYERS == 2 ? 2 : 4);
|
||||
|
||||
table.add(firstRowContainer);
|
||||
table.add(firstRowContainer);
|
||||
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i].setFontScale(labScale);
|
||||
if (i % 4 == 0)
|
||||
table.row().expandY().fillY();
|
||||
table.add(labels[i]).space(1);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i].getLabel().setFontScale(labScale);
|
||||
if (i % 4 == 0)
|
||||
table.row().expandY().fillY();
|
||||
table.add(buttons[i]).space(1);
|
||||
}
|
||||
}
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i].setFontScale(labScale);
|
||||
if (i % 4 == 0)
|
||||
table.row().expandY().fillY();
|
||||
table.add(labels[i]).space(1);
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i].getLabel().setFontScale(labScale);
|
||||
if (i % 4 == 0)
|
||||
table.row().expandY().fillY();
|
||||
table.add(buttons[i]).space(1);
|
||||
}
|
||||
}
|
||||
|
||||
table.row().colspan(MazeSettings.MAXPLAYERS == 2 ? 2 : 4);
|
||||
table.row().colspan(MazeSettings.MAXPLAYERS == 2 ? 2 : 4);
|
||||
// table.add(playBtn).fillX().width(buttonDim*2f).height(buttonDim);
|
||||
table.add(playBtn).fillX().expandX().height(buttonDim);
|
||||
}
|
||||
table.add(playBtn).fillX().expandX().height(buttonDim);
|
||||
}
|
||||
|
||||
MazePlayerLocal p;
|
||||
MazePlayerLocal p;
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
// Consantly search for new players to be added
|
||||
// First search for keyboard players (WASD and ARROWS)
|
||||
if (PlayerUtils.wasdJustPressed())
|
||||
PlayerUtils.togglePlayerWithKeys(players, PlayerUtils.WASDKEYS);
|
||||
if (PlayerUtils.arrowsJustPressed())
|
||||
PlayerUtils.togglePlayerWithKeys(players, PlayerUtils.ARROWKEYS);
|
||||
@Override
|
||||
public void update() {
|
||||
// Consantly search for new players to be added
|
||||
// First search for keyboard players (WASD and ARROWS)
|
||||
if (PlayerUtils.wasdJustPressed())
|
||||
PlayerUtils.togglePlayerWithKeys(players, PlayerUtils.WASDKEYS);
|
||||
if (PlayerUtils.arrowsJustPressed())
|
||||
PlayerUtils.togglePlayerWithKeys(players, PlayerUtils.ARROWKEYS);
|
||||
|
||||
// for (Controller c : Controllers.getControllers()) {
|
||||
// System.out.println(c.getButton(Xbox.A));
|
||||
|
||||
// if (c.getButton(Xbox.Y)) {
|
||||
// if (c.getButton(Xbox.Y)) {
|
||||
// p = getPlayerWithCtrl(c);
|
||||
// if (p == null)
|
||||
// p = new MazePlayerLocal(uiManager.main, c);
|
||||
|
@ -224,16 +224,16 @@ public class PlayerChooseScreen extends MyScreen {
|
|||
// }
|
||||
// }
|
||||
|
||||
// Update labels
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i].setText(i < players.size() ? "-- Player Ready! --" : "-- empty slot --");
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i].setText(buttons[i].isChecked() ? " -- Player Ready -- " : " -- empty slot -- ");
|
||||
}
|
||||
}
|
||||
}
|
||||
// Update labels
|
||||
if (AMazeIng.PLATFORM == Platform.DESKTOP) {
|
||||
for (int i = 0; i < labels.length; i++) {
|
||||
labels[i].setText(i < players.size() ? "-- Player Ready! --" : "-- empty slot --");
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < buttons.length; i++) {
|
||||
buttons[i].setText(buttons[i].isChecked() ? " -- Player Ready -- " : " -- empty slot -- ");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
package com.emamaker.amazeing.utils;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.math.Vector3;
|
||||
import com.emamaker.amazeing.AMazeIng;
|
||||
|
||||
|
@ -9,22 +13,76 @@ public class MathUtils extends net.dermetfan.gdx.math.MathUtils {
|
|||
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
|
||||
// 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;
|
||||
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;
|
||||
return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
|
||||
}
|
||||
|
||||
public static float pythagoreanTheorem(float a, float b) {
|
||||
return (float) Math.sqrt(a * a + b * b);
|
||||
}
|
||||
|
||||
public static Color getRandomColor(String s) {
|
||||
return getRandomColor(UUID.fromString(s));
|
||||
}
|
||||
|
||||
/**
|
||||
* Method return a random color.
|
||||
* https://stackoverflow.com/questions/38394240/how-to-generate-color-code-with-uuid-in-java
|
||||
*/
|
||||
public static Color getRandomColor(UUID u) {
|
||||
|
||||
byte[] bytes = UUID2Bytes(u);
|
||||
|
||||
float r = Math.abs(bytes[0]) / 255f;
|
||||
float g = Math.abs(bytes[1]) / 255f;
|
||||
float b = Math.abs(bytes[2]) / 255f;
|
||||
|
||||
float value = (r+g+b) / 3; //this is your value between 0 and 1
|
||||
float minHue = min(r, g, b);
|
||||
float maxHue = max(r, g, b);
|
||||
float hue = value*maxHue + (1-value)*minHue;
|
||||
Color c = new Color(java.awt.Color.HSBtoRGB(hue, 1, 1f));
|
||||
|
||||
System.out.println(r + ", " + g + ", " + b);
|
||||
|
||||
return new Color(c);
|
||||
}
|
||||
|
||||
public static float min(float... fs) {
|
||||
float r = Float.MAX_VALUE;
|
||||
for(float f : fs) {
|
||||
if(f < r) r = f;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
public static float max(float... fs) {
|
||||
float r = Float.MIN_VALUE;
|
||||
for(float f : fs) {
|
||||
if(f > r) r = f;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
public static byte[] UUID2Bytes(UUID uuid) {
|
||||
|
||||
long hi = uuid.getMostSignificantBits();
|
||||
long lo = uuid.getLeastSignificantBits();
|
||||
return ByteBuffer.allocate(16).putLong(hi).putLong(lo).array();
|
||||
}
|
||||
|
||||
public static class Constants {
|
||||
|
||||
public static int NETWORK_ACTION_TIMEOUT_MILLIS = 7000;
|
||||
|
|
Loading…
Reference in New Issue