Skip to content

Commit

Permalink
chore(gameobjects): increase damage of larger bubble
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jan 25, 2025
1 parent b67c08b commit d6b6609
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gameobjects/bubble.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { getDirection } from '../helpers'
import type { Bubble, Enemy, Player } from '../types'

const SPEED = 200
const DAMAGE = 20

export function addBubble(player: Player) {
const bubble = add([
Expand All @@ -15,13 +14,14 @@ export function addBubble(player: Player) {
anchor('center'),
scale(0.1),
Tag.Bubble,
{ damage: 20 },
])

bubble.onCollide(Tag.Enemy, (enemy) => {
play(Sound.Hit)
bubble.destroy()
const currentEnemy = enemy as Enemy
currentEnemy.hurt(DAMAGE)
currentEnemy.hurt(bubble.damage)

if (hasBubble(currentEnemy)) {
const childBubble = currentEnemy.get(Tag.Bubbled)[0] as Bubble
Expand Down Expand Up @@ -52,6 +52,7 @@ export function addBubble(player: Player) {
currentBubble.destroy()
} else {
currentBubble.scaleBy(1.1)
currentBubble.damage *= 1.5
}
})

Expand Down

0 comments on commit d6b6609

Please sign in to comment.