@@ -43,6 +43,7 @@ public class ArcBulletType extends BulletType{
43
43
public float spokeWidth = 2f , spokeLength = 8f ;
44
44
public float spikeSpin = 0.5f ;
45
45
public float zoneLifeOffset = 0f ;
46
+ public float growTime = 6f , shrinkTime = 0f ;
46
47
public Color zoneColor = Color .red , targetColor = Color .red ;
47
48
48
49
static {
@@ -89,6 +90,7 @@ public void init(){
89
90
a .isInheritive = true ;
90
91
a .zoneLifeOffset = a .zoneLifeOffset * a .lifetimeScl + lifetimeScl ;
91
92
}
93
+
92
94
if (intervalBullet instanceof ArcBulletType a ) a .isInheritive = true ;
93
95
94
96
super .init ();
@@ -272,30 +274,38 @@ public void drawTrail(Bullet b){
272
274
public void drawTargetZone (Bullet b ){
273
275
Draw .z (zoneLayer );
274
276
Draw .color (zoneColor );
277
+
278
+ float realLife = b .lifetime * lifetimeScl ;
279
+ float scl = Mathf .curve (b .time , 0 , growTime ) - Mathf .curve (b .time , realLife - shrinkTime , realLife );
280
+
275
281
float x = b .aimX , y = b .aimY ;
276
282
float ang = Mathf .randomSeed (b .id , 360 ) + b .time * spikeSpin ;
277
- if (drawZone && zoneRadius > 0f ){
278
- PMDrawf .ring (x , y , zoneRadius , zoneRadius + 2f );
283
+ float zR = zoneRadius * scl ;
284
+ if (drawZone && zR > 0f ){
285
+ PMDrawf .ring (x , y , zR , zR + 2f );
286
+ float sW1 = spikesWidth1 * scl , sL1 = spikesLength1 * scl ;
279
287
for (int i = 0 ; i < 4 ; i ++){
280
288
float a = ang + 90 * i ;
281
- Drawf .tri (x + Angles .trnsx (a , zoneRadius ), y + Angles .trnsy (a , zoneRadius ), spikesWidth1 , spikesLength1 , a + 180 );
282
- Drawf .tri (x + Angles .trnsx (a , zoneRadius ), y + Angles .trnsy (a , zoneRadius ), spikesWidth1 , spikesLength1 / 2f , a );
289
+ Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW1 , sL1 , a + 180 );
290
+ Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW1 , sL1 / 2f , a );
283
291
}
292
+ float sW2 = spikesWidth2 * scl , sL2 = spikesLength2 * scl ;
284
293
for (int i = 0 ; i < 4 ; i ++){
285
294
float a = ang + 45 + 90 * i ;
286
- Drawf .tri (x + Angles .trnsx (a , zoneRadius ), y + Angles .trnsy (a , zoneRadius ), spikesWidth2 , spikesLength2 , a + 180 );
287
- Drawf .tri (x + Angles .trnsx (a , zoneRadius ), y + Angles .trnsy (a , zoneRadius ), spikesWidth2 , spikesLength2 / 2f , a );
295
+ Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW2 , sL2 , a + 180 );
296
+ Drawf .tri (x + Angles .trnsx (a , zR ), y + Angles .trnsy (a , zR ), sW2 , sL2 / 2f , a );
288
297
}
289
298
}
290
299
291
300
float fin = b .fin () / lifetimeScl ;
292
- PMDrawf .progressRing (x , y , progressRadius , progressRadius + 4f , fin );
301
+ PMDrawf .progressRing (x , y , progressRadius * scl , ( progressRadius + 4f ) * scl , fin );
293
302
294
- PMDrawf .ring (x , y , targetRadius , targetRadius + 2f );
295
- Lines .stroke (spokeWidth );
303
+ PMDrawf .ring (x , y , targetRadius * scl , (targetRadius + 2f ) * scl );
304
+ Lines .stroke (spokeWidth * scl );
305
+ float tR = targetRadius * scl ;
296
306
for (int i = 0 ; i < 4 ; i ++){
297
307
float a = -ang + 90 * i ;
298
- Lines .lineAngleCenter (x + Angles .trnsx (a , targetRadius ), y + Angles .trnsy (a , targetRadius ), a , spokeLength , false );
308
+ Lines .lineAngleCenter (x + Angles .trnsx (a , tR ), y + Angles .trnsy (a , tR ), a , spokeLength * scl , false );
299
309
}
300
310
}
301
311
0 commit comments