From c6fbef33bafb656571428211d93a6b2d372553cb Mon Sep 17 00:00:00 2001 From: YamanSD Date: Thu, 16 May 2024 16:02:51 +0300 Subject: [PATCH] Working on buster --- assets/images/x_3.gif | Bin 8520 -> 10513 bytes js/Game/Sprites/BusterShot.js | 142 ++++++++++++++++++++++++++-------- js/Game/Sprites/Player.js | 65 ++++++++++++++-- 3 files changed, 165 insertions(+), 42 deletions(-) diff --git a/assets/images/x_3.gif b/assets/images/x_3.gif index f1cc11290cea0eddce401556eea6bb4fc3dc2862..8ba091ccd48ca380978f0f928a947c29aa528d1a 100644 GIT binary patch delta 10355 zcmV-(D2&(0LXlE`M@dFFIbrAnB>`{%03rDV0RR9;04x9i008I%B>{#YNMO)#Kp2Q< zFuxlj!g9S^!WJrU?>>i zC?Ndy{3tLu{O)Y*#&nRFr~m)}*rO*r@3ESm>ZU-fTS1Y>du45O63Mpg=%) zu#C=3e6Borus{rMEI)wXFlf(Txc|Sv(7^EjPniGz|Nl?e|B#rkpO~P3h@d}s-v9sr z000000001y`;w9Y4+IDQfJc*~0bPIJ;Njxq1q(Q~#?TT-bmG3j-4` zrr`Keg$oiikHkQ-!lT@URDyqAG(2?iM5X(#Ue3I^^L~Y2zZMX0;NsesB8;3o8H4sm znS)1eE0=1dHQC_#V)3POO7xk=#vp(7~E7!q|WX8FVm#1%_adn|3+&Ng!r|xYg%m4|o8HQF}Tt zEoBchsz_;W4FzN?uvQwuxe+*k!ITh0YN`Y1s#`#l3@qSMr0{=6KA#hxO6$T5H$000!Qwgr2OCTfrU1Ss(7{F>b^O|5$QB~toe8SdC#ujMm06!_ z1$k1B5}2G@1rMOS$X;%72jFL{R0$~t7oZz&rUm31@4AQtE&nvq{r)R-x(mQ+62j*? z0IS1TXRWm-5Wj!8-vnnC)pL32S`Uj$R}}^U1&~*L_12(=E_x%t8h~*; z9D#X2n;IK-*kRJKeG-5J3OE_bd8!;UcY!y8EuXa0?0|o_i4c#$kK^`yh`C2+xvA3W zV!*GH`But6mXKE-y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@bgm(P9fCYHfmXy0;q!&-jpoD4En9c*92TGplwHL|6g++{!V$ATtlr49Y;U)!tN!;V+6v)$-zKlaw%uBNm* zoVPz?y47-?2AyYY=TE0v+wQI^yyHFpO?!)(*S(%L!VhijFNe8-pl)}->pF0POVi3! znfFTJ%-2nS!@A!#2KdB@T5*fltl7Z8c*e_(>T$>U)QC>>!<$^@k#ifxCJ!69)5l#5 z8ywn!CU?HE#_1&c8{r~%w}?xgb7!_#$S+n^jESyfqZhfh5+6B#ncnnfQW(Bb_qntO zEz?0?oy=LE_}07Jb#S^I>;q>UVDPg7@BdQ9mB?>O6aeoqKNus=2w$)%?z>Q7HZ(#XT;}` zpHSt0!&wrVZE*BIOMQ@9zm1W|zJ7}@{poireM>cBPnCe@M^ed#fDV{{Ds_M)HGvbDZZm~} m7^s2o$AN9fX&^X)!Y5NCc!DUHf-1OzEZBkvE*MOK0028Nqe&G2 diff --git a/js/Game/Sprites/BusterShot.js b/js/Game/Sprites/BusterShot.js index e7d9bae..efd03a4 100644 --- a/js/Game/Sprites/BusterShot.js +++ b/js/Game/Sprites/BusterShot.js @@ -5,41 +5,123 @@ */ class BusterShot extends Sprite { - constructor(x, y, left, power, onUpdate, hitBoxBrush) { + /** + * @param x {number} + * @param y {number} + * @param left {boolean} + * @param power {number} + * @param enemies {Sprite[]} + * @param scale {number} + */ + constructor(x, y, left, power, enemies, scale) { super( {}, [x, y], - onUpdate, + () => { + const speed = 10 + 3 * power; + this.x += left ? -speed : speed; + + if ( + this.x > 2 * this.game.cameraRX + || this.rx < this.game.cameraX / 2 + ) { + this.game.removeSprite(this); + } + + for (const enemy of enemies) { + const col = this.colliding(enemy); + + if (col) { + enemy.damage(power * 5); + } + } + + this.moveCurrentAnimation(); + }, + undefined, + undefined, + undefined, + undefined, undefined, - hitBoxBrush + scale ); - this.currentAnimation = this.createAnimation( - 0, - 389, - 15, - 5, - 1, - 5, - 15, - 8, - 1, - 0, - 3 - ); + if (power <= 1) { + this.currentAnimation = this.createAnimation( + 0, + 388, + 15, + 5, + 1, + 5, + 15, + 8, + 1, + 0, + 3 + ); + + this.hitBox = this.convertHitBoxes([ + { + x, + y, + width: 15, + height: 8 + } + ]); + } else if (power < 3) { + this.currentAnimation = this.createAnimation( + 0, + 390, + 43, + 3, + 1, + 3, + 26, + 18, + 1, + 0, + 3 + ); + + this.hitBox = this.convertHitBoxes([ + { + x, + y, + width: 26, + height: 18 + } + ]); + } else { + this.currentAnimation = this.createAnimation( + 0, + 310, + 73, + 3, + 1, + 3, + 61, + 30, + 1, + 0, + 3 + ); + + this.hitBox = this.convertHitBoxes([ + { + x, + y, + width: 61, + height: 30 + } + ]); + } this.flip = left; } get defaultHitBox() { - return this.convertHitBoxes([ - { - x: this.x, - y: this.y, - width: this.width, - height: this.height - } - ]); + return []; } get desc() { @@ -47,26 +129,18 @@ class BusterShot extends Sprite { } draw(context) { - this.drawCurrentAnimation(this.x, this.y, context, 2); - } - - get height() { - return this.getAnimation(this.currentAnimation).singleHeight; + this.drawCurrentAnimation(this.x, this.y, context); } get type() { return "projectile"; } - get width() { - return this.getAnimation(this.currentAnimation).singleWidth; - } - /** * @returns {string[]} sprite sheets. */ static get sheets() { - return ['x_0.png']; + return ['x_3.gif']; } /** diff --git a/js/Game/Sprites/Player.js b/js/Game/Sprites/Player.js index 25a95b1..493cdc8 100644 --- a/js/Game/Sprites/Player.js +++ b/js/Game/Sprites/Player.js @@ -131,6 +131,7 @@ class Player extends Sprite { dashDuration: 50, // In ticks jumpForce: 10, gravity: 15, + power: 1, // Power of the shot initDashDuration: 50, // In ticks tempAnimation: undefined }, @@ -163,6 +164,12 @@ class Player extends Sprite { // If not active do not take commands if (this.states.get(PlayerControlsState) === PlayerControlsState.active) { + switch (this.states.get(PlayerAttackState)) { + case PlayerAttackState.charging: + this.power++; + break; + } + switch (this.states.get(PlayerDisplacementState)) { case PlayerDisplacementState.move: this.move(); @@ -231,6 +238,7 @@ class Player extends Sprite { 100, ); + // TODO add shooting animations and link // Create the animations this.#animations = { spawn_0: this.createAnimation( @@ -767,13 +775,21 @@ class Player extends Sprite { * dashDuration: number, * tempAnimation: number, * hoverTimer: number, - * maxHoverTimer: number + * maxHoverTimer: number, + * power: number * }} description of Player. */ get desc() { return super.desc; } + /** + * @returns {number} + */ + get power() { + return this.desc.power; + } + /** * @returns {number} previous player state. */ @@ -830,6 +846,13 @@ class Player extends Sprite { return this.desc.moveSpeed; } + /** + * @param v {number} + */ + set power(v) { + this.desc.power = v; + } + /** * @param v {number} new number of lives. */ @@ -890,6 +913,33 @@ class Player extends Sprite { ]); } + /** + * Charges the shot. + */ + charge() { + this.states.set(PlayerAttackState, PlayerAttackState.charging); + } + + /** + * Fires the shot. + */ + shoot() { + this.states.set(PlayerAttackState, PlayerAttackState.none); + + this.game.insertSprite( + new BusterShot( + this.rx, + this.y + this.height / 2, + this.flip, + Math.min(3, Math.ceil(this.power / 12)), + [], + this.scale + ) + ); + + this.power = 1; + } + /** * Activates the key listeners */ @@ -934,6 +984,9 @@ class Player extends Sprite { this.states.set(PlayerVerticalDisplacementState, PlayerVerticalDisplacementState.up); } break; + case 'x': + this.charge(); + break; } }; @@ -958,6 +1011,9 @@ class Player extends Sprite { case 'ArrowDown': this.states.set(PlayerVerticalDisplacementState, PlayerVerticalDisplacementState.float); break; + case 'x': + this.shoot(); + break; } }; @@ -1004,13 +1060,6 @@ class Player extends Sprite { this.game.addEventListener('keyup', keyLiftHandler); } - /** - * Starts the player nova attack. - */ - nova() { - - } - /** * Draws the rectangle in the 2d context. *