Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dungeon crawler #166

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions apps/client/src/app/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,20 @@ const flySquasherRoutes = [
}
] satisfies Routes;

const dungeonCrawlerRoutes = [
{
path: "dungeon-crawler",
children: [
{
path: "",
loadComponent: () =>
import("./dungeon-crawler/dungeon-crawler.component").then((m) => m.DungeonCrawlerComponent)
},
{ path: "**", redirectTo: "" }
]
}
] satisfies Routes;

const routes = [
{
path: "",
Expand All @@ -139,6 +153,7 @@ const routes = [
...littleMuncherRoutes,
...probableWaffleRoutes,
...flySquasherRoutes,
...dungeonCrawlerRoutes,
{
path: "**",
redirectTo: ""
Expand Down
10 changes: 5 additions & 5 deletions apps/client/src/app/app.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { SwRefreshComponent } from "./shared/components/sw-refresh/sw-refresh.co
import { RouterOutlet } from "@angular/router";

@Component({
selector: "fuzzy-waddle-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
standalone: true,
imports: [RouterOutlet, SwRefreshComponent]
selector: "fuzzy-waddle-root",
templateUrl: "./app.component.html",
styleUrls: ["./app.component.scss"],
standalone: true,
imports: [RouterOutlet, SwRefreshComponent]
})
export class AppComponent implements OnInit {
protected readonly authService = inject(AuthService);
Expand Down
48 changes: 48 additions & 0 deletions apps/client/src/app/dungeon-crawler/game/assets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
export enum AssetsDungeon {
"tiles" = "tiles",
"dungeon" = "dungeon",
"faune" = "faune",
"lizard" = "lizard",
"treasure" = "treasure",
"heartEmpty" = "heartEmpty",
"heartFull" = "heartFull",
"knife" = "knife"
}

// visible in tiled (tileset name)
export enum DungeonTilesetNames {
"dungeion" = "dungeion"
}

// layers of tile map (visible in tiled)
export enum DungeonTilesetLayers {
"Walls" = "Walls",
"Ground" = "Ground"
}

// custom names for animations
export enum AnimationsFaune {
"default" = "walk-down-3.png",
"idleDown" = "faune-idle-down",
"idleUp" = "faune-idle-up",
"idleSide" = "faune-idle-side",
"runDown" = "faune-run-down",
"runUp" = "faune-run-up",
"runSide" = "faune-run-side",
"faint" = "faune-faint"
}

export enum AnimationsChest {
"open" = "chest-open",
"close" = "chest-close"
}

export enum AnimationsLizard {
"default" = "lizard_m_idle_anim_f0.png",
"idle" = "idle",
"run" = "run"
}

export enum DungeonCrawlerSceneEventTypes {
"playerHealthChanged" = "playerHealthChanged"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum DungeonCrawlerScenes {
"PreloadSceneDungeon" = "PreloadSceneDungeon",
"MainSceneDungeon" = "MainSceneDungeon",
"DungeonUi" = "DungeonUi"
}
23 changes: 23 additions & 0 deletions apps/client/src/app/dungeon-crawler/game/game-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import DungeonPreloader from "./scenes/DungeonPreloader";
import Dungeon from "./scenes/Dungeon";
import DungeonUi from "./scenes/DungeonUi";
import { baseGameConfig } from "../../shared/game/base-game.config";

export const dungeonCrawlerGameConfig: Phaser.Types.Core.GameConfig = {
...baseGameConfig,
width: window.innerWidth / 2,
height: window.innerHeight / 2,
physics: {
default: "arcade",
arcade: {
gravity: { y: 0 },
debug: false
}
},
pixelArt: true,
scale: {
zoom: 2,
mode: Phaser.Scale.CENTER_BOTH
},
scene: [DungeonPreloader, Dungeon, DungeonUi]
};
10 changes: 8 additions & 2 deletions apps/client/src/app/home/page/home-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export type DisplayGame = {
})
export class HomePageComponent {
protected readonly environment = environment;
private readonly currentlyFeaturedGame = "fly-squasher";
private readonly currentlyFeaturedGame = "dungeon-crawler";
displayGames: DisplayGame[] = [
{
name: "Probable Waffle",
Expand All @@ -42,7 +42,6 @@ export class HomePageComponent {
description: "Infinite scroller",
image: "little-muncher.webp",
bannerImage: "probable-waffle-banner.webp",

route: "little-muncher"
},
{
Expand All @@ -51,6 +50,13 @@ export class HomePageComponent {
image: "fly-squasher.webp",
bannerImage: "fly-squasher-banner.webp",
route: "fly-squasher"
},
{
name: "Dungeon Crawler",
description: "Creepy crawlies",
image: "dungeon-crawler.webp",
bannerImage: "dungeon-crawler-banner.webp",
route: "dungeon-crawler"
}
];

Expand Down
Loading
Loading