Skip to content

Commit

Permalink
feat: add an actual background for bobber
Browse files Browse the repository at this point in the history
  • Loading branch information
Stan-Stani committed Jul 15, 2024
1 parent 8e57b86 commit aff7b5f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Binary file added public/bobber/background1.aseprite
Binary file not shown.
Binary file added public/bobber/background1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 6 additions & 5 deletions src/games/bobber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ export class BobberScene extends Scene {
}

preload() {
this.load.image('background1', './bobber/background1.png')
this.load.image('player', './bobber/player.png')
this.load.image('enemy', './enemy.png')
this.load.aseprite({
Expand All @@ -213,7 +214,11 @@ export class BobberScene extends Scene {
color: '#FFF',
fontFamily: 'gameboy',
})
// .setOrigin(0.5, 1)

const background = this.add.image(0, 0, 'background1')
background.setOrigin(0, 0).setDepth(-4).setScrollFactor(0)


this.physics.world.setBounds(0, 0, WIDTH * 11, HEIGHT)
this.cameras.main.setBounds(0, 0, 1024 * 4, HEIGHT)

Expand All @@ -231,10 +236,6 @@ export class BobberScene extends Scene {
typeof obj.x === 'number' &&
typeof obj.y === 'number'
)
console.log('hellod')
console.log('hellod')
console.log('hellod')
console.log('hellod')
const checkpoints = spawnLayer.objects.filter(
(obj): obj is spawnLocation =>
obj.type === 'checkpoint' &&
Expand Down

0 comments on commit aff7b5f

Please sign in to comment.