From 89199139f04c6ac65a960c06effeadbbde14e951 Mon Sep 17 00:00:00 2001 From: cindyle1 Date: Thu, 7 Sep 2023 17:05:26 +1000 Subject: [PATCH] Added more suitable animation as well as implementing activator --- .../images/projectiles/basic_projectile.atlas | 48 ++++++------------ .../images/projectiles/basic_projectile.png | Bin 1083 -> 961 bytes .../projectiles/basic_projectile_old.atlas | 41 +++++++++++++++ .../projectiles/basic_projectile_old.png | Bin 0 -> 1123 bytes .../core/assets/images/towers/mine_tower.png | Bin 0 -> 472 bytes source/core/assets/images/towers/turret.png | Bin 0 -> 5490 bytes .../assets/images/towers/turret_deployed.png | Bin 0 -> 3438 bytes .../core/assets/images/towers/wallTower.png | Bin 0 -> 3121 bytes .../csse3200/game/areas/ForestGameArea.java | 4 +- .../ProjectileAnimationController.java | 33 +++--------- .../components/tasks/TowerCombatTask.java | 2 +- .../game/components/tasks/TrajectTask.java | 23 ++++++++- .../entities/factories/ProjectileFactory.java | 32 +++++------- 13 files changed, 100 insertions(+), 83 deletions(-) create mode 100644 source/core/assets/images/projectiles/basic_projectile_old.atlas create mode 100644 source/core/assets/images/projectiles/basic_projectile_old.png diff --git a/source/core/assets/images/projectiles/basic_projectile.atlas b/source/core/assets/images/projectiles/basic_projectile.atlas index da0afb851..2f09b83bf 100644 --- a/source/core/assets/images/projectiles/basic_projectile.atlas +++ b/source/core/assets/images/projectiles/basic_projectile.atlas @@ -1,50 +1,34 @@ basic_projectile.png -size: 128, 32 +size: 256, 32 format: RGBA8888 filter: Nearest, Nearest repeat: none -projectileFinal5 - rotate: false - xy: 2, 17 - size: 24, 13 - orig: 24, 13 - offset: 0, 0 - index: 5 -projectile4 +projectile rotate: false xy: 2, 2 - size: 23, 13 - orig: 23, 13 + size: 36, 19 + orig: 36, 19 offset: 0, 0 index: 4 -projectile3 +projectileFinal rotate: false - xy: 27, 2 - size: 23, 13 - orig: 23, 13 + xy: 103, 3 + size: 30, 18 + orig: 30, 18 offset: 0, 0 index: 3 -projectile2 +projectile rotate: false - xy: 28, 17 - size: 23, 13 - orig: 23, 13 + xy: 40, 2 + size: 30, 19 + orig: 30, 19 offset: 0, 0 index: 2 -projectileStart1 +projectile rotate: false - xy: 53, 16 - size: 22, 14 - orig: 22, 14 + xy: 72, 2 + size: 29, 19 + orig: 29, 19 offset: 0, 0 index: 1 - default - rotate: false - xy: 53, 16 - size: 22, 14 - orig: 22, 14 - offset: 0, 0 - index: 1 - - diff --git a/source/core/assets/images/projectiles/basic_projectile.png b/source/core/assets/images/projectiles/basic_projectile.png index c95b5f6a501e0484c649eaec8bc0e4103bdc2317..abf6cfc59d0865975f238b941b8c25e3734cbeaf 100644 GIT binary patch literal 961 zcmV;y13vtTP)RlBfIx(F&7Ur3=)tfC8%ZtO;=3vnTWTNf?_cj8LW|3DXl zyP_)>7K#swkG3?nK8k1;rM7jPIl4ro)o=2)<&O3T4~{KnpQ`9==ZyWw#}&0Sr)nzPJ85~JJ9 zZp;*{GJ{}ts8EQmVw8PSwB}V_&UIm^DKLO}URu0AE(5T!mv6WDk`OS%kZ+&-?bn+s z4gqrvl&s%}DVe?5#-Nh^g9g9|fRMqZSOP=KEkO7-z^zggL%;|EXEExc*H`&avFr0t ziqinTx$|0il=h{^jQ?N0*BZR964V$tgE;g(Ile0ygG&1k8UWV}V5)y>=*q7HLKj|* zW&qZ<{ld4j;Zj@%5M!^`e)0U`41h@gBc^v4Kkoj620+Yjt^tf6NQQzz2Lu<5Ouf0V ztGxzb6o1gRYX-2M8O`Fa=NW*$-w*Y@L=eQ;f6$<4KfhhnV&$igl z*WGP){p7K1b*WNFf&q-#?pC`D5H2v-FAj_>cdEntE{9$&Zwub8!#9@ST=9-!vfcZh zs!B=%2C$dT9k6gD7;JZeNmOos!Inv;a@WUe0{-=IzZZhOgU-5CDTIdO-TB)-@5)LF z1~AC})hWQpzoW|Kpye{vN9%cAGsE5T)Kqao!%=t5yYt1N!%i?9b|p(N9DI3Qs9X-5 zLL`mtTbl!c9*62$nCLaLBR%r;RB<9OKGt{&~O+4KJW4x(cw_T!*XE8yLAahf`{pLa;7V| ztvrX|tW$=9<{PLye5x`^0&+PC9ITrj_yaW#3@`u5A#Y!9J^@7L^9}qvswzr?NCGD? z5!9X@j4Yo|0WbD@b>MTSGmfeZii4wIR4SE9rBYQxeAFLh)nAkx2+F}A-U+}bmg)8{ z&0vtAE)N#W%EjgoY-#M5H3afJ(jIFrBpb(dD+u%3K?(qEi+W7UL9ShGG@q|E`0KFz zd*q$W>>*F=nD>wIs&SP`g%0R48W&iuGt>qD0_jofKN0I(Yq4b~Kbwb6S2T$b;6@YnCv<|_mQ zmcO8Z$()73W(#C(xGn^o!4hPEw4}bfQgdMMM^DxM}03Heg24k7PuU;>h)yqw>@VTfQ zy$cYMjS=He2>4Yi;m17^CUN)_3IP8(y2paS=l79X^J!>bYVcByb4qlKxshy`D9fJ? z+(o4M{{Yp0A_*R@^wWV*=wsm=NP_29sZ_gMzX8m+*N_**@zDSP002ovPDHLkV1kvy B{EGkp diff --git a/source/core/assets/images/projectiles/basic_projectile_old.atlas b/source/core/assets/images/projectiles/basic_projectile_old.atlas new file mode 100644 index 000000000..988969366 --- /dev/null +++ b/source/core/assets/images/projectiles/basic_projectile_old.atlas @@ -0,0 +1,41 @@ + +basic_projectile_old.png +size: 256, 32 +format: RGBA8888 +filter: Nearest, Nearest +repeat: none +projectileFinal + rotate: false + xy: 34, 2 + size: 30, 19 + orig: 30, 19 + offset: 0, 0 + index: 5 +projectile + rotate: false + xy: 66, 2 + size: 30, 19 + orig: 30, 19 + offset: 0, 0 + index: 2 +projectile + rotate: false + xy: 98, 2 + size: 29, 19 + orig: 29, 19 + offset: 0, 0 + index: 1 +projectile + rotate: false + xy: 129, 2 + size: 29, 19 + orig: 29, 19 + offset: 0, 0 + index: 3 +default + rotate: false + xy: 129, 2 + size: 29, 19 + orig: 29, 19 + offset: 0, 0 + index: 3 \ No newline at end of file diff --git a/source/core/assets/images/projectiles/basic_projectile_old.png b/source/core/assets/images/projectiles/basic_projectile_old.png new file mode 100644 index 0000000000000000000000000000000000000000..ce05307e110ebabf7d9a6ae6d16e0644aa90d4c9 GIT binary patch literal 1123 zcmV-p1f2VcP)U6vvOWqCP?NA^HH__7RE*5-*}xB9f>J z^&$`ji@K;TA{ERtJOA;_*?Gp^*@x{s?F({^SyT_$I8SsH8(f5#+nhf+ z$Vs3su*sk7Ehg9&!0d_LvcI}k2$5u8jt2$NQ#`K{v^~+Iz3WY#wvuMIl5y3T1nhM~d7(ekm-DdEgB;tOzd2W25b}sQ`O8Sc^zHn+p<*(1@~4K| zqvY!XSh}@s_4oZQm`zBI<6PP1!CHI+&0pS85|5d&mf%<==+E&rd|J-6B=519XUsYI z#~|5QUG?q!%-Ft?1DaSd~&H0l8Ml zuJY2*;>XYH4N=qE;@6Vnc})V+*vogD1IcUA;&@XOkGUJg=3lzgQ1&FCa{~Dq-d>-* zW=#6>I*56g^NFE;Z_LRSK^Fj4*QAC@lZ?{^Q__TCK_nG}wyz5?snFmPY$eJ17T6Cb zfh7BaG^v(d<+Ts1D&qzWD6h@t6dB_62FuP_aVR zvW=c5%X2G#S-po3|*WU zyV1V^u;KfK-`Y-+wlDj-5F`6J{s!Q?c6tBX?E)r`+WZY*u+x1w8eatTbtA4;`hCQl zzX8-3x)^*)TBVZ;Yab1|*PFWUeB002ovPDHLkV1f(JEOh_? literal 0 HcmV?d00001 diff --git a/source/core/assets/images/towers/mine_tower.png b/source/core/assets/images/towers/mine_tower.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..aa2d5940cf30d22ce2758aa6549ffbd752fc75fa 100644 GIT binary patch literal 472 zcmeAS@N?(olHy`uVBq!ia0vp^${@_a1|;QfZjJ;}jKx9jP7LeL$-D%zD?D8sLn7SY zPCG5wV!+XstS*)yJ8#X=S2mHobKmeu778{toIGb?J$vz_4^N*9?)tLes%?kr-^48$ zf2RIyGtyW7nXg%wewop*?{RB-Z1^wTlDZQXOQ$%haQL|{xMO#xZTIHm2T~@aMqV=U zU1qi5)VAD}@2f@5lx9vBY-4vQ$aG+6Dm!e@(qLoIu4JRn(4o)8^Iyq9RYFwd)3VA& zof&Eh9B&yfCEQUk39)gRRCVOvqv$5fQ|0s0jiqclGe1R1n<@yh&6>s5#O|ruXK=-> z`BtvqKWBpw&Vn_z>_6@XonlUITXE&h5_QMZ%9s0d-gU)oj#smt@O;cmAO@yEQFdCZn|d2?whb<&qcTNy`hPzYckIp zJJpD)8GW33tSc+EPI}qZw^`>anWyFPYVGphpa_f*zSIcMG+$o^Eg+i%h(X{|@MI9> M>FVdQ&MBb@0GzS9nE(I) literal 0 HcmV?d00001 diff --git a/source/core/assets/images/towers/turret.png b/source/core/assets/images/towers/turret.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..025f187079cc9837e23231c4a124f900c5a1adfb 100644 GIT binary patch literal 5490 zcmb`~X*iVszrgXEsZbjHEZL_}wo1vqjEU@J-$Gtdn(;oh%92 zCCk{xHjHI3hu{A?|Lgp(^W=A~>)cQ7<-vV_Klg*z_5OzHXsKSl$bJz3fXnJ?5A*JRQ4cv|4o`lC5J5FII%O6%*dYU?M*t`{&b>*VY!@y!W@ zeu98OBCeawfeV^`0>7_?F$i3+HdW+->3}7!F44DQ0O|R^<^`la&jP3z2)`gzi&~V# zRZuP8{XpRU%dZC@36d8{+!9;5vV6_KqtF`)`5nGqT3VQ%T)KCNc(m*G;cQ+1`1nd$ z;e0OmIO7QM2=L7mJ5ul>H6bV;g;g|G&c*4WhaIA~WU-AQpn&yza>zmcgkZ>^2lPlo zdF86pWP|yK>N*T2e>YF@U@U#8)|W6fL*Fv97X{=4Y1Y1T#W%ab zNc`c_oVE)yqVH|CyAvJxH%bQe38?#eg70sN(HxoRlm)5RV?3~VJmg6!FplL5mq0dU z!0i|hdjw#4G??i6q~0&P#)s_rj_J3;z zEKyxiaJ}vUIACh*D#d(+)vtttViuNmk~Fxi*R*Ou^u0l&tY7D(F!VDgJqmo2A?vR0 z4ZQ6cnmnlCVMBGI%4aN+_>#Cd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U8GbZ8()Nlj2!fese{ z00NpxL_t(&-tAe-YTG~*JqrDRd_oG9Wl+&dkUH3j-R=y=i)_5k7ZkcGlrBo46l!pP zAZu^3Fb3^frERbx(8}NvSqu3S`Ulg6t*K`8upB)LI$&&#H8Vas_s)G7s8ORvjT$9D z$Z#!^)4GXplo0^}0B>IR__3&0@XnjYaZ8Wv?QRd9m#^r+r}ys)BXgAHL%F-v@$36HI-vdd ziM%3t5q8Wd)44cL73j(alUwx%!(8*MJf9Nr0;NB$eEstIzfy*@yS>7)-po=IZVl!b zj`5SsYZoDn*@#lpGna!9GCwt$Cy$xreTa=@mm}my?yEh~TVk5?61;)g+61m#UQ&iB!(sIz3^kzQ@2<_M#LYp*6VS?k#JR znqHX!k;IvhM`k?HK}N^h&8B~Nzsf8)rcp$Y6*WM{Ft=rGlv;Tq4H3dOA7n*^tf-WX zr;sq+9Mo|s+_b{FBmNEx|2^Lls)}iao?3=!g(?$wI8^fZT^MdanK0Z;uW&iKF68(n z`^Ya0H$cX_HcaafzaVKJbkvQso5*9ew9p?6q0MJ}(+zP!l8+_hiB8vv+bb!VSRzqo z;bpIWGKau0H_RGg@a><<^vEtokUeEAu>UWFr~)gl;ELP7MvWRZYE%b*0Xruv>@Omj Q?EnA(07*qoM6N<$f>}|P-~a#s literal 0 HcmV?d00001 diff --git a/source/core/assets/images/towers/wallTower.png b/source/core/assets/images/towers/wallTower.png index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e31daa176560db60399d99dc722ac58c23b72537 100644 GIT binary patch literal 3121 zcmV-149@e3P)EX>4Tx07!|QmUmQC*A|D*y?1({%`g-xL+`x}AiX!K(nMjH8DJ;_4l^{dA)*2i zMMMM@L4qO%jD{kyB8r88V8I@cAfUux6j4!mGqP56<>kGXm){>}eQTe+_dRFteb%}F zki7l5ymVL!fHa~vAmcQ z7uoQ$&mudEnVrUCi&%W-40ak@%snFBnkD3j81WZzQ5KhzE#g}u)=U+qaYg)A9Gk{r zW&(gBiR}UoD@n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#B8(7D%vBts82j>})Qw_}U zX5sG)&BEU?EW~9v0|SA1H1zRkJ3$3VljZ#bOkd*wG@qy&1q1;Aht-#hnti7?00000 LNkvXXu0mjfITP_a literal 0 HcmV?d00001 diff --git a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java index 55831795d..7450ae13a 100644 --- a/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java +++ b/source/core/src/main/com/csse3200/game/areas/ForestGameArea.java @@ -48,7 +48,7 @@ public class ForestGameArea extends GameArea { // Required to load assets before using them private static final String[] forestTextures = { - "images/projectiles/projectile.png", +// "images/projectiles/projectile.png", "images/box_boy_leaf.png", "images/background/building1.png", "images/ghost_1.png", @@ -85,7 +85,7 @@ public class ForestGameArea extends GameArea { "images/iso_grass_3.png", "images/economy/scrap.png", "images/towers/mine_tower.png", - "images/projectiles/basic_projectiles.png" + "images/projectiles/basic_projectile.png" }; private static final String[] forestTextureAtlases = { "images/terrain_iso_grass.atlas", diff --git a/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java b/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java index 84ffb2766..9c808a557 100644 --- a/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java +++ b/source/core/src/main/com/csse3200/game/components/projectile/ProjectileAnimationController.java @@ -2,22 +2,16 @@ import com.csse3200.game.components.Component; import com.csse3200.game.rendering.AnimationRenderComponent; -import com.csse3200.game.services.ServiceLocator; +import com.csse3200.game.services.ServiceLocator; //used for sound public class ProjectileAnimationController extends Component{ /** Event name constants */ - private static final String START = "startProjectileStart1"; - private static final String PHASE1 = "startProjectile2"; - private static final String PHASE2 = "startProjectile3"; - private static final String PHASE3 = "startProjectile4"; - private static final String FINAL = "startProjectileFinish5"; + private static final String START = "startProjectile"; + private static final String FINAL = "startProjectileFinal"; /** Animation name constants */ - private static final String START_ANIM = "projectileStart1"; - private static final String PHASE1_ANIM = "projectile2"; - private static final String PHASE2_ANIM = "projectile3"; - private static final String PHASE3_ANIM = "projectile4"; - private static final String FINAL_ANIM = "projectileFinish5"; + private static final String START_ANIM = "projectile"; + private static final String FINAL_ANIM = "projectileFinal"; AnimationRenderComponent animator; @@ -26,10 +20,7 @@ public void create() { super.create(); animator = this.entity.getComponent(AnimationRenderComponent.class); entity.getEvents().addListener(START, this::animateStart); - entity.getEvents().addListener(START, this::animatePhase1); - entity.getEvents().addListener(START, this::animatePhase2); - entity.getEvents().addListener(START, this::animatePhase3); - entity.getEvents().addListener(START, this::animateFinal); + entity.getEvents().addListener(FINAL, this::animateFinal); } @@ -37,18 +28,6 @@ void animateStart() { animator.startAnimation(START_ANIM); } - void animatePhase1() { - animator.startAnimation(PHASE1_ANIM); - } - - void animatePhase2() { - animator.startAnimation(PHASE2_ANIM); - } - - void animatePhase3() { - animator.startAnimation(PHASE3_ANIM); - } - void animateFinal() { animator.startAnimation(FINAL_ANIM); } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java index bae13b0fd..0d10d8dd6 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/TowerCombatTask.java @@ -113,7 +113,7 @@ public void updateTowerState() { owner.getEntity().getEvents().trigger(FIRING); // this might be changed to an event which gets triggered everytime the tower enters the firing state Entity newProjectile = ProjectileFactory.createFireBall(owner.getEntity(), new Vector2(100, owner.getEntity().getPosition().y), new Vector2(2f,2f)); - newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), (float) (owner.getEntity().getPosition().y + 0.75)); + newProjectile.setPosition((float) (owner.getEntity().getPosition().x + 0.75), (float) (owner.getEntity().getPosition().y + 0.4)); ServiceLocator.getEntityService().register(newProjectile); } } diff --git a/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java b/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java index 0741355b1..106c90fcb 100644 --- a/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java +++ b/source/core/src/main/com/csse3200/game/components/tasks/TrajectTask.java @@ -3,12 +3,22 @@ import com.badlogic.gdx.math.Vector2; import com.csse3200.game.ai.tasks.DefaultTask; import com.csse3200.game.ai.tasks.PriorityTask; +import com.csse3200.game.services.GameTime; /** Trajects a projectile from an entity towards the enemy entities */ public class TrajectTask extends DefaultTask implements PriorityTask { private final int priority = 10; private MovementTask movementTask; private Vector2 destination; + private static final String START = "startProjectile"; + private static final String FINAL = "startProjectileFinal"; + + private enum STATE { + START, FINAL + } + private STATE projectileState = STATE.START; + + private GameTime projectSpawn; /** * @param destination The destination that the projectile will move towards. @@ -26,8 +36,15 @@ public void start() { movementTask = new MovementTask(destination); movementTask.create(owner); movementTask.start(); - - this.owner.getEntity().getEvents().trigger("trajectStart"); + this.owner.getEntity().getEvents().trigger(START); + } + + public void switchProjectileState() { + switch (projectileState) { + case START: + this.owner.getEntity().getEvents().trigger(FINAL); + projectileState = STATE.FINAL; + } } @Override @@ -36,6 +53,7 @@ public void update() { movementTask.update(); if (movementTask.getStatus() != Status.ACTIVE) { movementTask.start(); + switchProjectileState(); } } @@ -43,6 +61,7 @@ public void update() { public void stop() { super.stop(); movementTask.stop(); + this.owner.getEntity().getEvents().trigger(FINAL); } @Override diff --git a/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java b/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java index 8dcd81b26..42b6e7034 100644 --- a/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java +++ b/source/core/src/main/com/csse3200/game/entities/factories/ProjectileFactory.java @@ -29,16 +29,10 @@ public class ProjectileFactory { /** Animation constants */ private static final String BASE_PROJECTILE_ATLAS = "images/projectiles/basic_projectile.atlas"; - private static final String START_ANIM = "projectileStart1"; - private static final String PHASE1_ANIM = "projectile2"; - private static final String PHASE2_ANIM = "projectile3"; - private static final String PHASE3_ANIM = "projectile4"; - private static final String FINAL_ANIM = "projectileFinish5"; - private static final float START_SPEED = 0.3f; - private static final float PHASE1_SPEED = 0.3f; - private static final float PHASE2_SPEED = 0.3f; - private static final float PHASE3_SPEED = 0.3f; - private static final float FINAL_SPEED = 0.3f; + private static final String START_ANIM = "projectile"; + private static final String FINAL_ANIM = "projectileFinal"; + private static final float START_SPEED = 0.1f; + private static final float FINAL_SPEED = 0.1f; private static final NPCConfigs configs = FileLoader.readClass(NPCConfigs.class, "configs/NPCs.json"); @@ -56,9 +50,17 @@ public static Entity createFireBall(Entity target, Vector2 destination, Vector2 Entity projectile = createBaseProjectile(target, destination); + AnimationRenderComponent animator = + new AnimationRenderComponent( + ServiceLocator.getResourceService() + .getAsset(BASE_PROJECTILE_ATLAS, TextureAtlas.class)); + animator.addAnimation(START_ANIM, START_SPEED, Animation.PlayMode.NORMAL); + animator.addAnimation(FINAL_ANIM, FINAL_SPEED, Animation.PlayMode.NORMAL); + projectile -// .addComponent(new TextureRenderComponent("images/projectiles/projectile.png")) + .addComponent(new ProjectileAnimationController()) .addComponent(new ColliderComponent().setSensor(true)) + .addComponent(animator) // This is the component that allows the projectile to damage a specified target. .addComponent(new TouchAttackComponent(PhysicsLayer.PLAYER, 1.5f, true)) @@ -70,14 +72,6 @@ public static Entity createFireBall(Entity target, Vector2 destination, Vector2 projectile .getComponent(PhysicsMovementComponent.class).setSpeed(speed); - AnimationRenderComponent animator = new AnimationRenderComponent( - ServiceLocator.getResourceService() - .getAsset(BASE_PROJECTILE_ATLAS, TextureAtlas.class)); - animator.addAnimation(START_ANIM, START_SPEED, Animation.PlayMode.NORMAL); - animator.addAnimation(PHASE1_ANIM, PHASE1_SPEED, Animation.PlayMode.NORMAL); - animator.addAnimation(PHASE2_ANIM, PHASE2_SPEED, Animation.PlayMode.NORMAL); - animator.addAnimation(PHASE3_ANIM, PHASE3_SPEED, Animation.PlayMode.NORMAL); - animator.addAnimation(FINAL_ANIM, FINAL_SPEED, Animation.PlayMode.NORMAL); return projectile; }