diff --git a/src/main.ts b/src/main.ts index 916faf1..502e330 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import Game from "./Wolfie2D/Loop/Game"; -import default_scene from "./default_scene"; +import MainMenu from "./shattered_sword/Scenes/MainMenu"; // The main function is your entrypoint into Wolfie2D. Specify your first scene and any options here. (function main(){ @@ -11,13 +11,15 @@ import default_scene from "./default_scene"; let options = { canvasSize: {x: 1200, y: 800}, // The size of the game clearColor: {r: 0, g: 0, b: 0}, // The color the game clears to + useWebGL: false, // Tell the game we want to use webgl + showDebug: true // Whether to show debug messages. You can change this to true if you want } // Create a game with the options specified const game = new Game(options); // Start our game - game.start(default_scene, {}); + game.start(MainMenu, {}); })(); function runTests(){}; \ No newline at end of file diff --git a/src/shattered_sword/InputWrapper.ts b/src/shattered_sword/InputWrapper.ts new file mode 100644 index 0000000..0959d31 --- /dev/null +++ b/src/shattered_sword/InputWrapper.ts @@ -0,0 +1,26 @@ +import Input from "./../Wolfie2D/Input/Input"; + +export default class InputWrapper { + private static isInStoryMode: boolean; + + constructor() { + InputWrapper.isInStoryMode = false; + } + + /** + * Returns whether or not the attack key is currently pressed + * @returns True if the attack key is pressed, false otherwise + */ + static isAttackJustPressed(): boolean { + if (InputWrapper.isInStoryMode) { + return false; + } + // TODO + return undefined; + } + + static setStoryMode(storyMode: boolean): void { + InputWrapper.isInStoryMode = storyMode; + } + +} \ No newline at end of file diff --git a/src/shattered_sword/Player/PlayerController.ts b/src/shattered_sword/Player/PlayerController.ts new file mode 100644 index 0000000..5f2111d --- /dev/null +++ b/src/shattered_sword/Player/PlayerController.ts @@ -0,0 +1,61 @@ +import StateMachineAI from "../../Wolfie2D/AI/StateMachineAI"; +import GameNode, { TweenableProperties } from "../../Wolfie2D/Nodes/GameNode"; +import Vec2 from "../../Wolfie2D/DataTypes/Vec2"; +import Sprite from "../../Wolfie2D/Nodes/Sprites/Sprite"; +import OrthogonalTilemap from "../../Wolfie2D/Nodes/Tilemaps/OrthogonalTilemap"; + +export enum BuffType { + ATK = "attack", + DEF = "defence" +} + +type Buff = { + "type": BuffType, + "value": number, + "bonus": boolean, +} + +type Buffs = [ + Buff, Buff, Buff +] + + +export default class PlayerController extends StateMachineAI { + protected owner: GameNode; + MAX_SPEED: number = 300; + BASE_HP: number = 100; + MAX_HP: number = 100; + CURRENT_HP: number = 100; + BASE_ATK: number = 100; + MAX_ATK: number = 100; + CURRENT_ATK: number = 100; + BASE_DEF: number = 100; + MAX_DEF: number = 100; + CURRENT_DEF: number = 100; + + CURRENT_BUFFS: { + atk: 0; + hp: 0; + def: 0; + speed: 0; + } + velocity: Vec2 = Vec2.ZERO; + tilemap: OrthogonalTilemap; + + /** + * Returns three legal random generate buffs based on current state + * @returns Three buffs + */ + static getBuffs(): Buffs { + // TODO + return undefined; + } + + /** + * Add given buff to the player + * @param buff Given buff + */ + setBuff(buff: Buff): void { + // TODO + } +} \ No newline at end of file diff --git a/src/shattered_sword/Scenes/Levels.ts b/src/shattered_sword/Scenes/Levels.ts new file mode 100644 index 0000000..2a9ff87 --- /dev/null +++ b/src/shattered_sword/Scenes/Levels.ts @@ -0,0 +1,5 @@ +import Scene from "../../Wolfie2D/Scene/Scene"; + +export default class Levels extends Scene { + // TODO +} \ No newline at end of file diff --git a/src/shattered_sword/Scenes/MainMenu.ts b/src/shattered_sword/Scenes/MainMenu.ts new file mode 100644 index 0000000..e2c1473 --- /dev/null +++ b/src/shattered_sword/Scenes/MainMenu.ts @@ -0,0 +1,5 @@ +import Scene from "../../Wolfie2D/Scene/Scene"; + +export default class MainMenu extends Scene { + // TODO +} \ No newline at end of file diff --git a/src/shattered_sword/Scenes/StoryMode.ts b/src/shattered_sword/Scenes/StoryMode.ts new file mode 100644 index 0000000..b367c39 --- /dev/null +++ b/src/shattered_sword/Scenes/StoryMode.ts @@ -0,0 +1,5 @@ +import Scene from "../../Wolfie2D/Scene/Scene"; + +export default class StoryMode extends Scene { + // TODO +} \ No newline at end of file diff --git a/src/shattered_sword/sword_enums.ts b/src/shattered_sword/sword_enums.ts new file mode 100644 index 0000000..a694489 --- /dev/null +++ b/src/shattered_sword/sword_enums.ts @@ -0,0 +1,13 @@ +export enum Player_Events { + PLAYER_MOVE = "PlayerMove", + PLAYER_JUMP = "PlayerJump", + PLAYER_ATTACK = "PlayerAttack", + PLAYER_DASH = "PlayerDash", + PLAYER_HEAL = "PlayerHeal", + PLAYER_KILLED = "PlayerKilled", +} +export enum Damage_Type { + NORMAL_DAMAGE = "NormalDamage", + ENVIRONMENT_DAMAGE = "EnvironmentDamage", + DOT_DAMAGE = "DOTDamage", +} \ No newline at end of file