From 90dd64b87cc68391d558ac7d486237257bfc0d30 Mon Sep 17 00:00:00 2001 From: Charlize Date: Sat, 16 Mar 2024 09:19:05 -0700 Subject: [PATCH] Testing a Melee Attack with Test Animation on Gumball + Creating a Dictionary of Attacks for Characters --- assets/darwin_talking.png | Bin 0 -> 3401 bytes assets/gumball_spritesheet.png | Bin 7200 -> 7293 bytes assets/gumball_talking.png | Bin 2940 -> 3605 bytes src/prefabs/Character.js | 95 ++++++++++++++++++++++++--------- src/prefabs/Enemy.js | 2 +- src/prefabs/Selection.js | 48 ++++++++++++----- src/scenes/Fighting.js | 62 ++++++++++++--------- src/scenes/Menu.js | 10 +++- 8 files changed, 153 insertions(+), 64 deletions(-) create mode 100644 assets/darwin_talking.png diff --git a/assets/darwin_talking.png b/assets/darwin_talking.png new file mode 100644 index 0000000000000000000000000000000000000000..537326bc7e62ea47444eed5a337624663ebae8c5 GIT binary patch literal 3401 zcmV-P4Yu-$P)f6 zXi@@54ZTQ_E-Enz5K6$103tR-RB%L5k){YTDBysjLy@r}iiH7DvFijGMAUI`6dRUF zWUU$Bym{}eS9UO(Z2>7`&z9wUXbV-Il#&6`Y8GKGQ04S2&F6MJnWNa;Ck|;8QE#r9r;7G||@X{|> z%+C|c55>;RS}qbKr-&IQTvLXPlM{>K&(BTgi^a?^4mXV>;xX8n8Ce|RasXz}{8imI52H3ZN4bfe_i~WlJ|C&UW9+{8AKoW!}eExnGFE2re(F+`iE_46#!l9 z0Z_aBhs|Iw0E)7{bq;-T9=d#9QpDmcXDh4R++0fmpKB>E=%LdZt9g$j;($`3&Zthxi`{{&gM}5&R^+h%b~yM9Zd3AWW9ETgVfL z1(`yIK=_}U_z%PWq}jQaiQ4!P(3V&Nr6C$XejWfQDiI(Fdt@un?|lo#M+5oIi_w{w zo%_#%{(V=tO#a9gB!7-$M?^BX5>d|Vn*3S!?g~$*UQipUPL&zMmg;!4Do9IA%up=Rh? z=qPj=x&RGBx1dpI68aT-2O}^EromdU5o`ssU{5#*j)WJ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hI!c3TJqBBV0VrsSER)x7R+KM0+FmxoO>sd@*TE$) zNAm&HChL1JZD_%_oSn`k2~dpJ3Js<_9T& f(%FW$$AW(Y69r7qeK3QI00000NkvXXu0mjfTEuOp literal 0 HcmV?d00001 diff --git a/assets/gumball_spritesheet.png b/assets/gumball_spritesheet.png index 8dec818d26f7263a79b5f225ed06e9f5de748eb8..59086a7f1b79bfaeb3943f839f5764232d0d8add 100644 GIT binary patch delta 4588 zcmW+)c{r5a8=mx0_99Ct*^PZ2TczyG*msRg_GQL4mM@Ignh+5&2*sceVIpQKW8c^8 zyRt7yX^_eC8^1r!IoG+*^E~%;-uK++y|4GR>WQjAqM3<4GXoC;2n1p_G|;i2j#z4Y zdzp^f^AW_J;RQ$xK%$|}eXD<8?c|$QI_lo&YC*aCYdk$rp>Vh8`<#NNm$C_CrGD26LCo*P<7R3#V>J8fo(Zxc&c(|@; zE#8q?$m`l2%+qYjQB+)4sa|i`+-_ViIGS7B)j$vCgbzko1B-{)B46C>7Xyr;3yuLAx*{<6(h#=GdqmIksq){w4!)1 zBX=~AQVP+V+$NutysT9PD5v+4$~i^<{D1BDjhNt#LsT_UHKAtQ-I)>QY??W!M53gBO9+rYQyCRcBWa6$96#<-q5V z?Wa1_AVh7-TTz!DWK{_8CTMAB3 z`an@aP6X6%zY}0k3Cb{wg_%SfeouT?bK%tM%7eHn@6C9lq~=a%fXZQEicC!TA?Zdl zbv&2$CHTA+$o>wV7BaBD1(JUx>6vI^{~{6dG;^5!0iyUB=uG9y6_*NFWk!VIc~tL4 zn4j0G)B*p;ams>^EGdSug0;VKLc(%PsUxj>nwnD^Z&BX#vy~pyJo2r$MLS|g1Arb! zbQX99Hv%d)rpV|NIu5QHnVRr}o%g=sKlb|w)L^L_cO9&M%G?~Vf*}OtoJ=dz#W#`i zOEg=TE3>|4_^M`3P+w?H%w)?|>?v&VP+~n6>|PM0QOqdyL2L_E!WZL>_bM%E(_d$q z3?m11P?_a)iF+fu@UU&R0!L!-&udA>a6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git a/assets/gumball_talking.png b/assets/gumball_talking.png index 21720778f1f2d7086f2bbf828ce98ecbbc5a117c..d64b68b41f378b0980a96d194d24981fe9d8a349 100644 GIT binary patch delta 872 zcmV-u1DE{#7L^3V#D3 zNkl&4-;|vO!NYqntxmHE{=?c&etlXSl|G*8`aQ3DRIC))>I9OZ4eu@ zD_G7TG!PI(tL_FTQNW3lvjrAZj9BfT=Lh}ck%2)~b7LPaXg0PRKwZCFuoX*49k80u z0RS$&+O-a*Ys&>2v9(GmfYd=LCa|q72du@)Q2BPtRWenW+tvnFVr|e~#(xA3VUH6^ z<7=_GpH505J2d9Xhu(lww^=;K*1Ps0z%5M#8#QmFBD1Mu%0k{cBhnoI>qXSY6xy z0!tCmK6YU8zIQM&_D^8Nh<{a%g%uIqoU?KWY{hcGVxlfxI;aR%V)xcoapBHgXRr!t zLvx;fT5SJjIRq8Ks>oYET||(}rd^2zpoQ8}&F8SZy#)Z69v(&E$~phL`A^@myuF3# z;Zdhej}dz?F$TbWTPQ+pi3+x2RdZK|<)$l@1%hDH+?7+!=diI;27drdULHf~#!Y3r z@i#A>u(e7F;yzo6?cXdzw~U#vCTJ9_2o7Nh+{$L~>&$5YyeXlY1~Qrh6)P#94?Gl1 zV9u1N=5u&AKj(kGR#*(6xm8txjaU(!t~c0ILI#WIICC|$H!y*z!hn5Qv;83CW^Zj3 z0PtgDCA{m>g&r2JXn&XN?0@l()AdFONnyYFCN#xmwU9xon2?mnujys{(AW2&HYc9E z_K)ed>S97tV*gL!*@Gz$0E%ySaW<6>eAjHZ0-tZ+x(Wc8dHg)yYx*c5D4@oQX|`L( zhxMV!6wvvzkNsTUSGFhYQRff90Du?kAN+HK?Mt4DRN>#LO!&J^jjJF40000gTe~DWM4f^#n{q diff --git a/src/prefabs/Character.js b/src/prefabs/Character.js index 5077212..55b246f 100644 --- a/src/prefabs/Character.js +++ b/src/prefabs/Character.js @@ -1,12 +1,11 @@ class Character extends Phaser.Physics.Arcade.Sprite { - // poop constructor(scene, x, y , texture, frame, health, mana, attack_dmg, name, power, type, index) { super(scene, x, y, texture) scene.add.existing(this) scene.physics.add.existing(this) this.body.setImmovable(true) - this.x = x - this.y = y + this.startX = x + this.startY = y // setting character properties this.index = index this.health = health @@ -22,12 +21,13 @@ class Character extends Phaser.Physics.Arcade.Sprite { this.collapsed = false // creating an array of attacks - this.attackList = Array(2).fill(-1) // Note: might make a dictionary - + // this.attackList = Array(2).fill(-1) // Note: might make a dictionary + this.attackList = {} + this.selectedAttack = 0 + // debugging this.state = 'idle' - - + this.projectile = new Projectile(scene, this.x + this.width/2, this.y - this.height/2, `${this.name}_projectile`, this) scene.FSM_holder[index] = new StateMachine('idle', { @@ -38,6 +38,13 @@ class Character extends Phaser.Physics.Arcade.Sprite { },[scene, this]) } + addAttack(name, power, mana_cost, type = 0) { + // this.attackList[Object.keys(this.attackList).length] = [name, power, mana_cost] + + // type 0 = physical, type 1 = mana + this.attackList[name] = [power, mana_cost, type] + } + } @@ -45,7 +52,7 @@ class IdleState extends State { // in this state the character may only enter the attack and hurt state enter (scene, character) { character.state = 'idle' - console.log(character.attackList) + // console.log(character.attackList) // console.log(character.name + 'has entered the IDLE state') // player is not attacking in idle state character.clearTint() @@ -85,37 +92,77 @@ class AttackState extends State { // character will play a temporary attack animation where they throw their character specific attack enter (scene, character) { // remove the enemies health - console.log(scene.selectionMenu.current_attack) - if (scene.selectionMenu.current_attack == 1){ - // if you have selected a magic attack then play the magic attack - character.mana -= 10 - scene.characters_mp[character.index].match(character.mana) - - } - character.state = 'attack' - + // character.state = 'attack' + console.log("current attack: " + character.selectedAttack) + // if (scene.selectionMenu.current_attack == 1){ + // // if you have selected a magic attack then play the magic attack + // character.mana -= 10 + // scene.characters_mp[character.index].match(character.mana) + + // } + + // console.log("MANA COST: " + Object.entries(character.attackList)[scene.selectionMenu.current_attack][1][1]) + // character.mana -= Object.entries(character.attackList)[scene.selectionMenu.current_attack][1][1] + console.log("MANA COST: " + Object.entries(character.attackList)[character.selectedAttack][1][1]) + character.mana -= Object.entries(character.attackList)[character.selectedAttack][1][1] + scene.characters_mp[character.index].match(character.mana) - scene.dmgToEnemy = character.attack_dmg + // scene.dmgToEnemy = character.attack_dmg + // console.log("DAMAGE: " + Object.entries(character.attackList)[scene.selectionMenu.current_attack][1][0]) + // scene.dmgToEnemy = Object.entries(character.attackList)[scene.selectionMenu.current_attack][1][0] + console.log("DAMAGE: " + Object.entries(character.attackList)[character.selectedAttack][1][0]) + scene.dmgToEnemy = Object.entries(character.attackList)[character.selectedAttack][1][0] + scene.selectionMenu.allowSelect = false // console.log("selection allow is "+ scene.selectionMenu.allowSelect) character.setTint(0xDB91EF) + - character.projectile.move(scene.enemy) + console.log(Object.entries(character.attackList)[character.selectedAttack][1][2] == 0) + if (Object.entries(character.attackList)[character.selectedAttack][1][2] == 0) { + character.body.setVelocityX(scene.enemy.x - character.x) + this.collision = false; + } + else { + character.projectile.move(scene.enemy) + } - scene.time.delayedCall(character.hurtTimer, () => { - character.willAttack = false - character.hasAttacked = true - }) + // scene.time.delayedCall(character.hurtTimer, () => { + // character.willAttack = false + // character.hasAttacked = true + // }) } execute(scene, character) { // reset to idle - if (character.hasAttacked == true){ + if (character.hasAttacked == true && character.x >= character.startX){ + character.body.setVelocityX(0) scene.selectionMenu.charChange(0) // character.projectile.reset(character.x) this.stateMachine.transition('idle') } + + scene.physics.add.collider(character, scene.enemy, () => { + // let collision = scene.enemy.projectile.handleCollision(character, scene.dmgToEnemy) + // if ( collision == true){ + // // reset that projectile once the collision is true + // console.log('collision was true') + // scene.enemy.projectile.resetProj(scene.enemy.projectile.startX, scene.enemy.projectile.startY) + // this.stateMachine.transition('hurt') + // // is entered + // } + if (this.collision == false) { + character.body.setVelocityX(0) + this.collision = true; + } + character.anims.play(`${character.name}_melee`, true) + character.once('animationcomplete', () => { + character.willAttack = false + character.hasAttacked = true + character.setVelocityX(-1 * (scene.enemy.x - character.x)) + }) + }, null, scene) } } diff --git a/src/prefabs/Enemy.js b/src/prefabs/Enemy.js index 0768dbc..7659324 100644 --- a/src/prefabs/Enemy.js +++ b/src/prefabs/Enemy.js @@ -191,4 +191,4 @@ class DefeatState extends State { execute(scene, enemy) { } -} \ No newline at end of file +} diff --git a/src/prefabs/Selection.js b/src/prefabs/Selection.js index a9916d6..08ee908 100644 --- a/src/prefabs/Selection.js +++ b/src/prefabs/Selection.js @@ -23,7 +23,8 @@ class SelectionMenu extends Phaser.GameObjects.Graphics{ this.cursorImage = scene.add.image(x + -36, y + this.cursor_pos, 'cursor').setOrigin(0.5, 0) this.charDisplay = scene.add.bitmapText(x + -28, y + -20, 'font', this.characters[this.current_player].name, 8) this.item = scene.add.bitmapText(x + -28, y + -8, 'font', "PHONE", 8) - this.powerDisplay = scene.add.bitmapText( x + -28, y + 4, 'font', this.characters[this.current_player].attackList[this.current_attack], 8) + // this.powerDisplay = scene.add.bitmapText( x + -28, y + 4, 'font', this.characters[this.current_player].attackList[this.current_attack], 8) + this.powerDisplay = scene.add.bitmapText( x + -28, y + 4, 'font', Object.entries(this.characters[this.current_player].attackList)[this.current_attack][0], 8) this.selections = [ this.powerDisplay, this.item, this.charDisplay ] this.selections[this.current_selection].setTint(0xDFFF00); this.availableChar = this.scene.checkActive() @@ -53,9 +54,26 @@ class SelectionMenu extends Phaser.GameObjects.Graphics{ // Attack choice if ( this.characters[this.availableChar[this.current_player]].collapsed == false && !this.characters[this.availableChar[this.current_player]].hasAttacked){ // NOTE: check if character has died - this.characters[this.availableChar[this.current_player]].willAttack = true - this.attackingPlayer =this.characters[this.availableChar[this.current_player]] - this.charChange(0); + // if (this.current_attack == 1) { + // if (this.characters[this.availableChar[this.current_player]].mana > ) { + + // } + // } + + if (this.characters[this.availableChar[this.current_player]].mana >= Object.entries(this.characters[this.availableChar[this.current_player]].attackList)[this.current_attack][1][1]) { + this.characters[this.availableChar[this.current_player]].willAttack = true + this.characters[this.availableChar[this.current_player]].selectedAttack = this.current_attack + this.attackingPlayer = this.characters[this.availableChar[this.current_player]] + this.allowSelect = false + this.charChange(0) + } + else { + return + } + + // this.characters[this.availableChar[this.current_player]].willAttack = true + // this.attackingPlayer =this.characters[this.availableChar[this.current_player]] + // this.charChange(0); } } if (this.current_selection == 1 && !this.scene.summon.hasAttacked && this.scene.summon.summonUses && this.availableChar.length == 3){ @@ -122,12 +140,15 @@ class SelectionMenu extends Phaser.GameObjects.Graphics{ this.charChange(1) } this.charCursor.x = this.characters[this.availableChar[this.current_player]].x+ 15 - console.log(this.availableChar) - console.log(this.current_player) - console.log(this.characters[this.availableChar[this.current_player]]) + // console.log(this.availableChar) + // console.log(this.current_player) + // console.log(this.characters[this.availableChar[this.current_player]]) this.charDisplay.text = this.characters[this.availableChar[this.current_player]].name - this.powerDisplay.text = this.characters[this.availableChar[this.current_player]].attackList[this.current_attack] + // this.powerDisplay.text = this.characters[this.availableChar[this.current_player]].attackList[this.current_attack] + this.powerDisplay.text = Object.entries(this.characters[this.availableChar[this.current_player]].attackList)[this.current_attack][0] + + // this.attackChange(0) } @@ -136,14 +157,15 @@ class SelectionMenu extends Phaser.GameObjects.Graphics{ // manuever through the selected characters attacks console.log(input) this.current_attack += input - if (this.current_attack >= this.characters[this.availableChar[this.current_player]].attackList.length){ + if (this.current_attack >= Object.entries(this.characters[this.availableChar[this.current_player]].attackList).length){ this.current_attack = 0 } else if (this.current_attack < 0){ - this.current_attack = this.characters[this.availableChar[this.current_player]].attackList.length - 1 + this.current_attack = Object.entries(this.characters[this.availableChar[this.current_player]].attackList).length - 1 } - console.log('current attack' + this.current_attack) - this.powerDisplay.text = this.characters[this.availableChar[this.current_player]].attackList[this.current_attack] + // console.log('current attack' + this.current_attack) + console.log('current attack: ' + Object.entries(this.characters[this.availableChar[this.current_player]].attackList)[this.current_attack][0]) + this.powerDisplay.text = Object.entries(this.characters[this.availableChar[this.current_player]].attackList)[this.current_attack][0] } -} \ No newline at end of file +} diff --git a/src/scenes/Fighting.js b/src/scenes/Fighting.js index 783dcdd..48eb0c4 100644 --- a/src/scenes/Fighting.js +++ b/src/scenes/Fighting.js @@ -36,13 +36,21 @@ class Fighting extends Phaser.Scene { // adding a character to scene - each character should have their own HP this.gumball = new Character(this, rightPos-tileSize, floorY + tileSize /1.5, 'gumball', 0, this.hp, MP, 30, 'GUMBALL', 'MAGIC', 'physical', 0).setOrigin(0,1) - this.gumball.attackList = [ 'SCRATCH', 'MAGIC'] + // this.gumball.attackList = [ 'SCRATCH', 'MAGIC'] + this.gumball.addAttack("SCRATCH", 120, 0); + this.gumball.addAttack("MAGIC", 50, 10, 1); + console.log(Object.entries(this.gumball.attackList)) this.anais = new Character(this, rightPos, floorY +tileSize / 1.5, 'anais', 0, this.hp, MP, 50, 'ANAIS', 'SCIENCE', 'mage', 1).setOrigin(0,1) - this.anais.attackList = [ 'PUNCH', 'SCIENCE' ] + // this.anais.attackList = [ 'PUNCH', 'SCIENCE' ] + this.anais.addAttack("PUNCH", 25, 0); + this.anais.addAttack("SCIENCE", 200, 25, 1); this.darwin = new Character(this, rightPos + tileSize, floorY + tileSize / 1.5, 'darwin', 0, this.hp, MP, 10, 'DARWIN', 'SUPPORT', 'mage', 2).setOrigin(0,1) - this.darwin.attackList = [ 'SLAP', 'SUPPORT' ] + // this.darwin.attackList = [ 'SLAP', 'SUPPORT' ] + this.darwin.addAttack("SLAP", 40, 0); + this.darwin.addAttack("SUPPORT", 40, 15, 1); + // adding each character health this.gumball_hp = new HealthBar(this, centerX, floorY + tileSize, this.gumball, 0) this.gumball_mp = new ManaBar(this, centerX + tileSize * 3 + 12, floorY + tileSize, this.gumball, 0) @@ -129,32 +137,36 @@ class Fighting extends Phaser.Scene { this.FSM_holder[2].step() this.enemyFSM.step() - if (Phaser.Input.Keyboard.JustDown(space)){ - this.selectionMenu.select() - } - if (this.selectionMenu.current_selection == 0){ - if (Phaser.Input.Keyboard.JustDown(right)){ - this.selectionMenu.attackChange(1) + // console.log(this.selectionMenu.allowSelect) + + if (this.selectionMenu.allowSelect) { + if (Phaser.Input.Keyboard.JustDown(space)){ + this.selectionMenu.select() } - if (Phaser.Input.Keyboard.JustDown(left)){ - this.selectionMenu.attackChange(-1) + if (this.selectionMenu.current_selection == 0){ + if (Phaser.Input.Keyboard.JustDown(right)){ + this.selectionMenu.attackChange(1) + } + if (Phaser.Input.Keyboard.JustDown(left)){ + this.selectionMenu.attackChange(-1) + } } - } - - if (this.selectionMenu.current_selection == 2){ - if (Phaser.Input.Keyboard.JustDown(right)){ - this.selectionMenu.charChange(1) + + if (this.selectionMenu.current_selection == 2){ + if (Phaser.Input.Keyboard.JustDown(right)){ + this.selectionMenu.charChange(1) + } + if (Phaser.Input.Keyboard.JustDown(left)){ + this.selectionMenu.charChange(-1) + } } - if (Phaser.Input.Keyboard.JustDown(left)){ - this.selectionMenu.charChange(-1) + + if (Phaser.Input.Keyboard.JustDown(up)){ + this.selectionMenu.lookChoice(1) + } + if (Phaser.Input.Keyboard.JustDown(down)){ + this.selectionMenu.lookChoice(-1) } - } - - if (Phaser.Input.Keyboard.JustDown(up)){ - this.selectionMenu.lookChoice(1) - } - if (Phaser.Input.Keyboard.JustDown(down)){ - this.selectionMenu.lookChoice(-1) } } } diff --git a/src/scenes/Menu.js b/src/scenes/Menu.js index 513e56e..66639dc 100644 --- a/src/scenes/Menu.js +++ b/src/scenes/Menu.js @@ -33,7 +33,7 @@ class Menu extends Phaser.Scene{ //setting up character sprite sheet this.load.spritesheet('gumball', 'gumball_spritesheet.png', { - frameWidth: 30, + frameWidth: 38, frameHeight: 42 }) @@ -47,6 +47,8 @@ class Menu extends Phaser.Scene{ frameWidth: 46, frameHeight: 35 }) + this.load.image('darwin_talk', 'darwin_talking.png') + this.load.spritesheet('penny', 'penny_spritesheet.png', { frameWidth: 43, frameHeight: 60 @@ -95,6 +97,12 @@ class Menu extends Phaser.Scene{ repeat: -1, frames: this.anims.generateFrameNumbers('gumball', { start: 0, end: 7}), }) + this.anims.create({ + key: 'GUMBALL_melee', + frameRate: 8, + repeat: -1, + frames: this.anims.generateFrameNumbers('gumball', { start: 8, end: 15}), + }) this.anims.create({ key: 'GUMBALL_collapse', frameRate: 8,