Fix seed not resetting every run

This commit is contained in:
Flashfyre committed 2023-10-19 22:19:14 -04:00
1 parent e54632007d
commit 245d07b307
2 files changed
+3 -5

No files matched your search

+3 -3
View File
@@ -317,9 +317,6 @@ export default class BattleScene extends Phaser.Scene {
}
create() {
this.seed = this.game.config.seed[0];
console.log('Seed:', this.seed);
initGameSpeed.apply(this);
this.setupControls();
@@ -535,6 +532,9 @@ export default class BattleScene extends Phaser.Scene {
}
reset(): void {
this.seed = Utils.randomString(16);
console.log('Seed:', this.seed);
this.pokeballCounts = Object.fromEntries(Utils.getEnumValues(PokeballType).filter(p => p <= PokeballType.MASTER_BALL).map(t => [ t, 0 ]));
this.pokeballCounts[PokeballType.POKEBALL] += 5;
-2
View File
@@ -1,11 +1,9 @@
import Phaser from 'phaser';
import BattleScene from './battle-scene';
import * as Utils from './utils';
const config: Phaser.Types.Core.GameConfig = {
type: Phaser.WEBGL,
parent: 'app',
seed: [ Utils.randomString(16) ],
scale: {
width: 1920,
height: 1080,