Skip to content

Commit

Permalink
Fixed Projectiles and Changed SpriteSheets
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlizeSerrano5 committed Mar 13, 2024
1 parent 628c7b7 commit 9404b41
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 7 deletions.
Binary file modified assets/anais_spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/char_cursor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/nicole_spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/penny_spritesheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ let config = {
physics: {
default: "arcade",
arcade: {
debug: true,
// debug: true,
// gravity not needed
// gravity: {
// x: 0,
Expand Down
4 changes: 2 additions & 2 deletions src/prefabs/Enemy.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Enemy extends Phaser.GameObjects.Sprite {
scene.add.existing(this)

scene.physics.add.existing(this)
this.body.setImmovable = true;
this.body.setImmovable(true)
// setting enemy properties
this.health = health
this.name = name
Expand Down Expand Up @@ -72,7 +72,7 @@ class DefaultState extends State {
if (scene.selectionMenu.attackingPlayer){
// console.log(scene.selectionMenu.attackingPlayer.projectile)

scene.physics.add.collider(scene.selectionMenu.attackingPlayer.projectile, enemy, scene.selectionMenu.attackingPlayer.projectile.handleCollision, null, scene)
scene.physics.add.collider(scene.selectionMenu.attackingPlayer.projectile, enemy, scene.selectionMenu.attackingPlayer.projectile.handleCollision.bind(scene.selectionMenu.attackingPlayer.projectile), null, scene)
}

}
Expand Down
6 changes: 4 additions & 2 deletions src/prefabs/Projectile.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ class Projectile extends Phaser.Physics.Arcade.Sprite{

handleCollision(){
console.log("HANDLING COLLISION")
// this.x = this.startX
console.log("original x = " + this.x + "set x " + this.startX)
this.x = this.startX
// console.log("original x = " + this.x + "set x " + this.startX)

// this.resetProj(this.startX)

// set up animations for projectile LATER
return true
}

Expand Down
9 changes: 7 additions & 2 deletions src/scenes/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,14 @@ class Menu extends Phaser.Scene{
frameHeight: 35
})
this.load.spritesheet('penny', 'penny_spritesheet.png', {
frameWidth: 39,
frameHeight: 59
frameWidth: 43,
frameHeight: 60
})
this.load.spritesheet('nicole', 'nicole_spritesheet.png', {
frameWidth: 40,
frameHeight: 72
})

this.load.spritesheet('ANAIS_projectile', 'sci_proj_spritesheet.png', {
frameWidth: 16,
frameHeight: 16
Expand Down

0 comments on commit 9404b41

Please sign in to comment.