-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: splitting concerns between a "core" and "game"
When starting the split of the game state, I realized there's a lot of "not touching for long time" code spread everywhere, while next to something we may change a dozen of times a week. With that I also cleaned the imports.
- Loading branch information
Showing
39 changed files
with
143 additions
and
99 deletions.
There are no files selected for viewing
8 changes: 4 additions & 4 deletions
8
src/ui/animation/animation-timed.tsx → src/core/animation/animation-timed.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/ui/animation/animation.test.tsx → src/core/animation/animation.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/state/lib/state-machine.test.tsx → ...core/state-machine/state-machine.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/state/lib/state-machine.tsx → src/core/state-machine/state-machine.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/ui/components/AbstractFlex.ts → src/core/ui/AbstractFlex.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import PhaserGamebus from "@game/lib/gamebus"; | ||
|
||
import { AbstractScene } from "./index"; | ||
import { SCENES } from "./scenes"; | ||
|
||
/** | ||
* Example scene | ||
* | ||
* Copy this file, place it where it is relevant, update dependencies and have fun :) | ||
* Don't forget to add the scene to the scenes.ts file | ||
*/ | ||
|
||
export class GameScene extends AbstractScene { | ||
declare bus: Phaser.Events.EventEmitter; | ||
declare gamebus: PhaserGamebus; | ||
|
||
camera: Phaser.Cameras.Scene2D.Camera; | ||
|
||
constructor() { | ||
super(SCENES.GAME); | ||
} | ||
|
||
key_one!: Phaser.Input.Keyboard.Key; | ||
key_two!: Phaser.Input.Keyboard.Key; | ||
|
||
create() { | ||
this.bus = this.gamebus.getBus(); | ||
|
||
this.camera = this.cameras.main; | ||
|
||
this.key_one = this.input.keyboard!.addKey( | ||
Phaser.Input.Keyboard.KeyCodes.ONE | ||
); | ||
this.key_two = this.input.keyboard!.addKey( | ||
Phaser.Input.Keyboard.KeyCodes.TWO | ||
); | ||
|
||
this.registerSystems(); | ||
|
||
this.key_one.on("down", () => { | ||
console.log("key_one"); | ||
}); | ||
|
||
this.key_two.on("down", () => { | ||
console.log("key_two"); | ||
}); | ||
} | ||
|
||
registerSystems() { | ||
console.log("registering systems"); | ||
} | ||
|
||
update(_time: number, _delta: number) {} | ||
|
||
shutdown() {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.