Skip to content

Commit b216b29

Browse files
committed
Grow
1 parent 2099fff commit b216b29

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

src/progressed/entities/bullet/pseudo3d/ArcBulletType.java

+20-10
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public class ArcBulletType extends BulletType{
4343
public float spokeWidth = 2f, spokeLength = 8f;
4444
public float spikeSpin = 0.5f;
4545
public float zoneLifeOffset = 0f;
46+
public float growTime = 6f, shrinkTime = 0f;
4647
public Color zoneColor = Color.red, targetColor = Color.red;
4748

4849
static{
@@ -89,6 +90,7 @@ public void init(){
8990
a.isInheritive = true;
9091
a.zoneLifeOffset = a.zoneLifeOffset * a.lifetimeScl + lifetimeScl;
9192
}
93+
9294
if(intervalBullet instanceof ArcBulletType a) a.isInheritive = true;
9395

9496
super.init();
@@ -272,30 +274,38 @@ public void drawTrail(Bullet b){
272274
public void drawTargetZone(Bullet b){
273275
Draw.z(zoneLayer);
274276
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+
275281
float x = b.aimX, y = b.aimY;
276282
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;
279287
for(int i = 0; i < 4; i++){
280288
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);
283291
}
292+
float sW2 = spikesWidth2 * scl, sL2 = spikesLength2 * scl;
284293
for(int i = 0; i < 4; i++){
285294
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);
288297
}
289298
}
290299

291300
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);
293302

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;
296306
for(int i = 0; i < 4; i++){
297307
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);
299309
}
300310
}
301311

0 commit comments

Comments
 (0)