Turning the "importsNotUsedAsValues" TS config value to "error". This will require us to use `import type` instead of `import` when we are importing a value that is only used as a type (and therefore that is dropped by the Typescript compiler). Why this change? This is a requirement to be able to use Svelte in the future. See https://github.com/sveltejs/svelte-preprocess/issues/206#issuecomment-663193798
62 lines
1.8 KiB
TypeScript
62 lines
1.8 KiB
TypeScript
import { SelectCharacterScene } from "./SelectCharacterScene";
|
|
|
|
export class SelectCharacterMobileScene extends SelectCharacterScene {
|
|
|
|
create(){
|
|
super.create();
|
|
this.selectedRectangle.destroy();
|
|
}
|
|
|
|
protected defineSetupPlayer(numero: number){
|
|
const deltaX = 30;
|
|
const deltaY = 2;
|
|
let [playerX, playerY] = this.getCharacterPosition();
|
|
let playerVisible = true;
|
|
let playerScale = 1.5;
|
|
let playserOpactity = 1;
|
|
|
|
if( this.currentSelectUser !== numero ){
|
|
playerVisible = false;
|
|
}
|
|
if( numero === (this.currentSelectUser + 1) ){
|
|
playerY -= deltaY;
|
|
playerX += deltaX;
|
|
playerScale = 0.8;
|
|
playserOpactity = 0.6;
|
|
playerVisible = true;
|
|
}
|
|
if( numero === (this.currentSelectUser + 2) ){
|
|
playerY -= deltaY;
|
|
playerX += (deltaX * 2);
|
|
playerScale = 0.8;
|
|
playserOpactity = 0.6;
|
|
playerVisible = true;
|
|
}
|
|
if( numero === (this.currentSelectUser - 1) ){
|
|
playerY -= deltaY;
|
|
playerX -= deltaX;
|
|
playerScale = 0.8;
|
|
playserOpactity = 0.6;
|
|
playerVisible = true;
|
|
}
|
|
if( numero === (this.currentSelectUser - 2) ){
|
|
playerY -= deltaY;
|
|
playerX -= (deltaX * 2);
|
|
playerScale = 0.8;
|
|
playserOpactity = 0.6;
|
|
playerVisible = true;
|
|
}
|
|
return {playerX, playerY, playerScale, playserOpactity, playerVisible}
|
|
}
|
|
|
|
/**
|
|
* Returns pixel position by on column and row number
|
|
*/
|
|
protected getCharacterPosition(): [number, number] {
|
|
return [
|
|
this.game.renderer.width / 2,
|
|
this.game.renderer.height / 3
|
|
];
|
|
}
|
|
|
|
}
|