Skip to content
Snippets Groups Projects
Commit 04d8d205 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: #fe responsive player height

parent b9a8e8d9
No related branches found
No related tags found
No related merge requests found
......@@ -189,10 +189,11 @@ export default class FightScene extends Phaser.Scene {
}
createPlayer() {
this.player = this.physics.add
.sprite(0, 0, "oezi")
.setScale(3)
.setInteractive();
this.player = this.physics.add.sprite(0, 0, "oezi").setInteractive();
this.player.setScale(
// NOTE: this is a magic number related to critter height
(this.cameras.main.width * 0.15) / this.player.displayHeight,
);
this.player.setPosition(
// NOTE: just outside the bound and above the ground
this.cameras.main.width + 0.5 * this.player.displayWidth,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment