Added Tutorial Level and movement

This commit is contained in:
OfficialCHenry 2022-04-04 03:23:10 -04:00
parent 5bc079756d
commit 6906d361b0
11 changed files with 282 additions and 2 deletions

View File

@ -0,0 +1,27 @@
{
"name": "Hiro",
"spriteSheetImage": "Hiro.png",
"spriteWidth": 32,
"spriteHeight": 32,
"columns": 1,
"rows": 1,
"durationType": "time",
"animations": [
{
"name": "IDLE",
"frames": [ {"index": 0, "duration": 540} ]
},
{
"name": "JUMP",
"frames":[ {"index": 0, "duration": 32}]
},
{
"name": "WALK",
"frames": [ {"index": 0, "duration": 540} ]
},
{
"name": "FALL",
"frames": [ {"index": 0, "duration": 540} ]
}
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 819 B

View File

@ -0,0 +1,59 @@
{ "compressionlevel":-1,
"height":20,
"infinite":false,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 50, 50, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 0, 0, 0, 0, 49, 50, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 26, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 34, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 54, 54, 54, 54, 55, 0, 0, 33, 34, 34, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 55, 0, 0, 53, 54, 54, 54, 54, 54, 33, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 33, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 33, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 33, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 35, 41, 42, 42, 42, 42, 43, 0, 0, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43, 0, 0, 41, 34, 34, 34, 34, 43],
"height":20,
"id":1,
"name":"Main",
"opacity":1,
"properties":[
{
"name":"Collidable",
"type":"bool",
"value":true
}],
"type":"tilelayer",
"visible":true,
"width":30,
"x":0,
"y":0
},
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":20,
"id":2,
"name":"Background",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":30,
"x":0,
"y":0
}],
"nextlayerid":3,
"nextobjectid":1,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.8.2",
"tileheight":16,
"tilesets":[
{
"columns":8,
"firstgid":1,
"image":"forest_tileset.png",
"imageheight":128,
"imagewidth":128,
"margin":0,
"name":"forest_tileset",
"spacing":0,
"tilecount":64,
"tileheight":16,
"tilewidth":16
}],
"tilewidth":16,
"type":"map",
"version":"1.8",
"width":30
}

View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.8" tiledversion="1.8.4" name="bamboo_forest" tilewidth="16" tileheight="16" tilecount="64" columns="8">
<image source="forest_tileset.png" width="128" height="128"/>
</tileset>

View File

@ -0,0 +1,107 @@
{ "compressionlevel":-1,
"height":20,
"infinite":false,
"layers":[
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 35,
33, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 0, 0, 33, 34, 34, 34, 34, 35,
41, 42, 42, 42, 42, 42, 43, 0, 0, 41, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 42, 43, 0, 0, 41, 42, 42, 42, 42, 43],
"height":20,
"id":1,
"name":"Main",
"opacity":1,
"properties":[
{
"name":"Collidable",
"type":"bool",
"value":true
},
{
"name":"Depth",
"type":"int",
"value":1
},
{
"name":"Group",
"type":"string",
"value":"ground"
}],
"type":"tilelayer",
"visible":true,
"width":30,
"x":0,
"y":0
},
{
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"height":20,
"id":2,
"name":"Background ",
"opacity":1,
"type":"tilelayer",
"visible":true,
"width":30,
"x":0,
"y":0
}],
"nextlayerid":6,
"nextobjectid":1,
"orientation":"orthogonal",
"renderorder":"right-down",
"tiledversion":"1.8.4",
"tileheight":16,
"tilesets":[
{
"firstgid":1,
"columns":8,
"image":"forest1.png",
"imageheight":128,
"imagewidth":128,
"margin":0,
"name":"forest1",
"spacing":0,
"tilecount":64,
"tileheight":16,
"tilewidth":16
}],
"tilewidth":16,
"type":"map",
"version":"1.8",
"width":30
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

@ -11,7 +11,10 @@ import Jump from "./PlayerStates/Jump";
import Walk from "./PlayerStates/Walk"; import Walk from "./PlayerStates/Walk";
import Debug from "../../Wolfie2D/Debug/Debug"; import Debug from "../../Wolfie2D/Debug/Debug";
export enum PlayerType {
PLATFORMER = "platformer",
TOPDOWN = "topdown"
}
export enum PlayerStates { export enum PlayerStates {
IDLE = "idle", IDLE = "idle",

View File

@ -72,8 +72,10 @@ export default class GameLevel extends Scene {
// Start the black screen fade out // Start the black screen fade out
this.levelTransitionScreen.tweens.play("fadeOut"); this.levelTransitionScreen.tweens.play("fadeOut");
//TODO - uncomment when done testing
// Initially disable player movement // Initially disable player movement
Input.disableInput(); //Input.disableInput();
Input.enableInput();
} }
@ -150,6 +152,37 @@ export default class GameLevel extends Scene {
] ]
}); });
this.levelTransitionScreen = <Rect>this.add.graphic(GraphicType.RECT, "UI", {position: new Vec2(300, 200), size: new Vec2(600, 400)});
this.levelTransitionScreen.color = new Color(34, 32, 52);
this.levelTransitionScreen.alpha = 1;
this.levelTransitionScreen.tweens.add("fadeIn", {
startDelay: 0,
duration: 1000,
effects: [
{
property: TweenableProperties.alpha,
start: 0,
end: 1,
ease: EaseFunctionType.IN_OUT_QUAD
}
],
onEnd: Player_Events.LEVEL_END
});
this.levelTransitionScreen.tweens.add("fadeOut", {
startDelay: 0,
duration: 1000,
effects: [
{
property: TweenableProperties.alpha,
start: 1,
end: 0,
ease: EaseFunctionType.IN_OUT_QUAD
}
],
onEnd: Player_Events.LEVEL_START
});
} }

View File

@ -12,6 +12,7 @@ import Layer from "../../Wolfie2D/Scene/Layer";
import Label from "../../Wolfie2D/Nodes/UIElements/Label"; import Label from "../../Wolfie2D/Nodes/UIElements/Label";
import MainMenu from "./MainMenu"; import MainMenu from "./MainMenu";
import SceneWithStory from "./SceneWithStory"; import SceneWithStory from "./SceneWithStory";
import Tutorial from "./Tutorial";
export default class Levels extends Scene { export default class Levels extends Scene {
@ -25,6 +26,13 @@ export default class Levels extends Scene {
this.primary = this.addUILayer("primary"); this.primary = this.addUILayer("primary");
const tutorial = this.add.uiElement(UIElementType.BUTTON, "primary", {position: new Vec2(center.x, center.y - 200), text: "tutorial "});
tutorial.size.set(200, 50);
tutorial.borderWidth = 2;
tutorial.borderColor = Color.WHITE;
tutorial.backgroundColor = Color.TRANSPARENT;
tutorial.onClickEventId = "tutorial";
const level1 = this.add.uiElement(UIElementType.BUTTON, "primary", {position: new Vec2(center.x, center.y - 150), text: "level 1"}); const level1 = this.add.uiElement(UIElementType.BUTTON, "primary", {position: new Vec2(center.x, center.y - 150), text: "level 1"});
level1.size.set(200, 50); level1.size.set(200, 50);
level1.borderWidth = 2; level1.borderWidth = 2;
@ -74,6 +82,7 @@ export default class Levels extends Scene {
back.backgroundColor = Color.TRANSPARENT; back.backgroundColor = Color.TRANSPARENT;
back.onClickEventId = "back"; back.onClickEventId = "back";
this.receiver.subscribe("tutorial");
this.receiver.subscribe("level1"); this.receiver.subscribe("level1");
this.receiver.subscribe("level2"); this.receiver.subscribe("level2");
this.receiver.subscribe("level3"); this.receiver.subscribe("level3");
@ -89,6 +98,11 @@ export default class Levels extends Scene {
console.log(event); console.log(event);
if(event.type === "tutorial"){
this.sceneManager.changeToScene(Tutorial, {});
}
if(event.type === "level1"){ if(event.type === "level1"){
this.sceneManager.changeToScene(MainMenu, {}); this.sceneManager.changeToScene(MainMenu, {});
} }

View File

@ -0,0 +1,33 @@
import Vec2 from "../../Wolfie2D/DataTypes/Vec2";
import Debug from "../../Wolfie2D/Debug/Debug";
import { GameEventType } from "../../Wolfie2D/Events/GameEventType";
import GameLevel from "./GameLevel";
export default class Tutorial extends GameLevel{
loadScene(): void {
// Load resources
this.load.tilemap("forest1", "shattered_sword_assets/tilemaps/Tutorial.json");
this.load.spritesheet("player", "shattered_sword_assets/spritesheets/Hiro.json")
//load music here
}
startScene(): void {
// Add the level 1 tilemap
this.add.tilemap("forest1", new Vec2(2, 2));
this.viewport.setBounds(0, 0, 64*32, 20*32);
this.playerSpawn = new Vec2(5*32, 9*32);
// Do generic setup for a GameLevel
super.startScene();
}
updateScene(deltaT: number): void {
super.updateScene(deltaT);
}
}