Skip to content

Commit

Permalink
feat(sprites): add drain
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jan 26, 2025
1 parent 727f544 commit 92b742f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Binary file added public/sprites/drain.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/constants/sprite.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export enum Sprite {
Bubbie = 'Bubbie',
Bubble = 'Bubble',
Drain = 'Drain',
Gooba = 'Gooba',
Kiki = 'Kiki',
Pokey = 'Pokey',
Expand Down
8 changes: 4 additions & 4 deletions src/gameobjects/drain.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tag } from '../constants'
import { Sprite, Tag } from '../constants'
import { insideCoordinates } from '../helpers'
import type { Enemy } from '../types'

Expand All @@ -9,12 +9,12 @@ enum Lifespan {

export function addDrain() {
const drain = add([
circle(rand(20, 40)),
color(0, 0, 0),
sprite(Sprite.Drain),
pos(insideCoordinates()),
area(),
area({ scale: 0.7 }),
body({ isStatic: true }),
anchor('center'),
scale(0.7),
lifespan(rand(Lifespan.Min, Lifespan.Max), { fade: 0.5 }),
opacity(1),
Tag.Drain,
Expand Down
1 change: 1 addition & 0 deletions src/scenes/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ scene(Scene.Preload, () => {

const sprites = [
[Sprite.Bubble, 'sprites/bubble.png'],
[Sprite.Drain, 'sprites/drain.png'],
[Sprite.Projectile, 'sprites/projectile.png'],
]

Expand Down

0 comments on commit 92b742f

Please sign in to comment.