Skip to content

Commit

Permalink
Rename Main to FirstLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
pierpo committed Oct 17, 2018
1 parent bc7224f commit bb694aa
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion assets/second-map.json
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"properties":
{
"comesBackFrom":"right",
"scene":"Main"
"scene":"FirstLevel"
},
"propertytypes":
{
Expand Down
2 changes: 1 addition & 1 deletion assets/second-map.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -5607,7 +5607,7 @@
<object id="11" x="2" y="280" width="16" height="47">
<properties>
<property name="comesBackFrom" value="right"/>
<property name="scene" value="Main"/>
<property name="scene" value="FirstLevel"/>
</properties>
</object>
</objectgroup>
Expand Down
4 changes: 2 additions & 2 deletions src/constants/maps.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const MAPS = {
main: {
firstLevel: {
file: 'tilemap.json',
key: 'main',
key: 'first-level',
},
second: {
file: 'second-map.json',
Expand Down
2 changes: 1 addition & 1 deletion src/constants/scenes.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const SCENES = {
UI: 'UIScene',
MAIN: 'Main',
FIRST_LEVEL: 'FirstLevel',
SECOND: 'Second',
};
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'phaser';
import { Main } from './scenes/Main';
import { FirstLevel } from './scenes/FirstLevel';
import { Second } from './scenes/Second';
import { Preloader } from './scenes/Preloader';
import { UIScene } from './scenes/UIScene';
Expand All @@ -19,7 +19,7 @@ class PhaserGame extends Phaser.Game {
// debug: true,
// },
},
scene: [Preloader, Main, Second, UIScene],
scene: [Preloader, FirstLevel, Second, UIScene],
};
super(config);
}
Expand Down
4 changes: 2 additions & 2 deletions src/scenes/Main.ts → src/scenes/FirstLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { AbstractScene } from './AbstractScene';
import { SCENES } from '../constants/scenes';
import { MAPS } from '../constants/maps';

export class Main extends AbstractScene {
export class FirstLevel extends AbstractScene {
constructor() {
super(SCENES.MAIN, MAPS.main.key);
super(SCENES.FIRST_LEVEL, MAPS.firstLevel.key);
}
}
4 changes: 2 additions & 2 deletions src/scenes/Preloader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ export class Preloader extends Phaser.Scene {

protected create() {
this.createAnimations();
this.scene.launch(SCENES.MAIN);
this.scene.launch(SCENES.FIRST_LEVEL);
this.scene.launch(SCENES.UI);
}

private loadAssets() {
this.load.tilemapTiledJSON(MAPS.main.key, `assets/${MAPS.main.file}`);
this.load.tilemapTiledJSON(MAPS.firstLevel.key, `assets/${MAPS.firstLevel.file}`);
this.load.tilemapTiledJSON(MAPS.second.key, `assets/${MAPS.second.file}`);

// Images
Expand Down

0 comments on commit bb694aa

Please sign in to comment.