Skip to content

Commit

Permalink
refactor(gameobjects): allow position to be passed to player
Browse files Browse the repository at this point in the history
  • Loading branch information
remarkablemark committed Jan 17, 2024
1 parent c95250f commit a8390f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gameobjects/player.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { bean } from '../sprites'

export function addPlayer() {
return add([bean, pos(center()), rotate(0), anchor('center')])
export function addPlayer(x = center().x, y = center().y) {
return add([bean, pos(x, y), rotate(0), anchor('center')])
}

0 comments on commit a8390f3

Please sign in to comment.