fix: reset timer in mainmenu

This commit is contained in:
Renge 2022-04-24 18:18:36 -04:00
parent b59dc3e585
commit afb7d2bac5
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,6 @@ import Timer from "../../Wolfie2D/Timing/Timer";
import Color from "../../Wolfie2D/Utils/Color"; import Color from "../../Wolfie2D/Utils/Color";
import { EaseFunctionType } from "../../Wolfie2D/Utils/EaseFunctions"; import { EaseFunctionType } from "../../Wolfie2D/Utils/EaseFunctions";
import PlayerController from "../Player/PlayerController"; import PlayerController from "../Player/PlayerController";
import MainMenu from "./MainMenu";
import { GameState, Player_Events, Statuses } from "../sword_enums"; import { GameState, Player_Events, Statuses } from "../sword_enums";
import RegistryManager from "../../Wolfie2D/Registry/RegistryManager"; import RegistryManager from "../../Wolfie2D/Registry/RegistryManager";
import WeaponType from "../GameSystems/items/WeaponTypes/WeaponType"; import WeaponType from "../GameSystems/items/WeaponTypes/WeaponType";
@ -33,7 +32,6 @@ import Stack from "../../Wolfie2D/DataTypes/Stack";
import InputWrapper from "../Tools/InputWrapper"; import InputWrapper from "../Tools/InputWrapper";
import Story from "../Tools/DataTypes/Story"; import Story from "../Tools/DataTypes/Story";
import Sprite from "../../Wolfie2D/Nodes/Sprites/Sprite"; import Sprite from "../../Wolfie2D/Nodes/Sprites/Sprite";
import Platformer from "../../demos/Platformer";
import TextInput from "../../Wolfie2D/Nodes/UIElements/TextInput"; import TextInput from "../../Wolfie2D/Nodes/UIElements/TextInput";
import { TiledTilemapData } from "../../Wolfie2D/DataTypes/Tilesets/TiledData"; import { TiledTilemapData } from "../../Wolfie2D/DataTypes/Tilesets/TiledData";
import AttackAction from "../AI/EnemyActions/AttackAction"; import AttackAction from "../AI/EnemyActions/AttackAction";
@ -135,7 +133,7 @@ export default class GameLevel extends Scene {
protected endCheckPoint: Rect; protected endCheckPoint: Rect;
protected touchedStartCheckPoint: boolean = false; protected touchedStartCheckPoint: boolean = false;
protected touchedEndCheckPoint: boolean = false; protected touchedEndCheckPoint: boolean = false;
protected static gameTimer: number = 0; static gameTimer: number = 0;
protected gameStarted: boolean = false; protected gameStarted: boolean = false;
protected timerLable: Label; protected timerLable: Label;
protected levelEnded: boolean = false; protected levelEnded: boolean = false;

View File

@ -11,6 +11,7 @@ import Layer from "../../Wolfie2D/Scene/Layer";
import Label from "../../Wolfie2D/Nodes/UIElements/Label"; import Label from "../../Wolfie2D/Nodes/UIElements/Label";
import Levels from "./Levels"; import Levels from "./Levels";
import RandomMapGenerator from "../Tools/RandomMapGenerator"; import RandomMapGenerator from "../Tools/RandomMapGenerator";
import GameLevel from "./GameLevel";
export default class MainMenu extends Scene { export default class MainMenu extends Scene {
protected config: ConfigManager; protected config: ConfigManager;
@ -30,6 +31,7 @@ export default class MainMenu extends Scene {
//TODO //TODO
startScene(): void{ startScene(): void{
GameLevel.gameTimer = 0;
const center = this.viewport.getCenter(); const center = this.viewport.getCenter();
// The main menu // The main menu