-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#17] feature: add game map, revise tailwind color styling declaratio…
…n to allow color to be used as var
- Loading branch information
Showing
18 changed files
with
1,243 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export default function GameLayout({ | ||
children, | ||
}: { | ||
children: React.ReactNode; | ||
}) { | ||
return <div className="h-screen">{children}</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { GameMap } from "@/components/map"; | ||
import { Background } from "@/components/background"; | ||
|
||
export default function GamePage() { | ||
return ( | ||
<> | ||
<Background cls=" h-full" isFullScreen={true}/> | ||
<section className="h-full flex flex-col justify-center items-center bg-brown/40"> | ||
|
||
<div className="flex justify-center items-center p-4 w-full h-[80%]"> | ||
<GameMap width={1080} height={720} /> | ||
</div> | ||
</section> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import bgImage from "@/assets/background.png"; | ||
import { cn } from "@/lib/utils"; | ||
import Image from "next/image"; | ||
|
||
interface Props { | ||
isFullScreen?: boolean | ||
cls?: string | ||
} | ||
export const Background = ({ isFullScreen = false, cls }: Props) => { | ||
return ( | ||
<div className={cn("w-full h-full", isFullScreen && "absolute z-[-10]", cls)}> | ||
<Image | ||
src={bgImage} | ||
fill | ||
alt="map-background" | ||
className={cn('object-center', isFullScreen ? 'object-cover' : 'object-contain')} | ||
/> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from './map-data' | ||
export * from './nodes' | ||
export * from './styling' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
import { MapData } from "../map.interface"; | ||
import { | ||
BoardwalkNode, | ||
CafeNode, | ||
ChurchNode, | ||
DinerNode, | ||
DocksNode, | ||
FactoryNode, | ||
FarmsteadNode, | ||
GraveyardNode, | ||
GreatHallNode, | ||
HistoricInnNode, | ||
HospitalNode, | ||
JunkyardNode, | ||
MarketNode, | ||
OldMillNode, | ||
ParkNode, | ||
PawnShopNode, | ||
PoliceStationNode, | ||
SecretLodgeNode, | ||
SwampNode, | ||
TheaterNode, | ||
TrainStationNode, | ||
UniversityNode, | ||
WharfNode, | ||
WoodsNode, | ||
} from "./nodes"; | ||
|
||
export const mapData: MapData = { | ||
nodes: [ | ||
// Arkham Nodes | ||
TrainStationNode, | ||
UniversityNode, | ||
PoliceStationNode, | ||
DinerNode, | ||
SecretLodgeNode, | ||
ParkNode, | ||
|
||
// Dunwich Nodes | ||
CafeNode, | ||
OldMillNode, | ||
FarmsteadNode, | ||
ChurchNode, | ||
SwampNode, | ||
HistoricInnNode, | ||
|
||
// Kingsport Nodes | ||
GreatHallNode, | ||
TheaterNode, | ||
GraveyardNode, | ||
WharfNode, | ||
MarketNode, | ||
WoodsNode, | ||
|
||
// Innsmouth Nodes | ||
JunkyardNode, | ||
PawnShopNode, | ||
DocksNode, | ||
HospitalNode, | ||
FactoryNode, | ||
BoardwalkNode, | ||
], | ||
links: [ | ||
{ source: TrainStationNode, target: UniversityNode }, | ||
{ source: UniversityNode, target: PoliceStationNode }, | ||
{ source: PoliceStationNode, target: ParkNode }, | ||
{ source: ParkNode, target: UniversityNode }, | ||
|
||
{ source: PoliceStationNode, target: SecretLodgeNode }, | ||
{ source: SecretLodgeNode, target: DinerNode }, | ||
{ source: ParkNode, target: SecretLodgeNode }, | ||
{ source: TrainStationNode, target: CafeNode }, | ||
{ source: DinerNode, target: JunkyardNode }, | ||
|
||
{ source: CafeNode, target: ChurchNode }, | ||
{ source: ChurchNode, target: OldMillNode }, | ||
{ source: ChurchNode, target: HistoricInnNode }, | ||
{ source: ChurchNode, target: FarmsteadNode }, | ||
{ source: HistoricInnNode, target: FarmsteadNode }, | ||
{ source: FarmsteadNode, target: SwampNode }, | ||
{ source: SwampNode, target: GreatHallNode }, | ||
|
||
{ source: JunkyardNode, target: PawnShopNode }, | ||
{ source: PawnShopNode, target: HospitalNode }, | ||
{ source: HospitalNode, target: FactoryNode }, | ||
{ source: FactoryNode, target: PawnShopNode }, | ||
{ source: FactoryNode, target: BoardwalkNode }, | ||
{ source: BoardwalkNode, target: DocksNode }, | ||
{ source: DocksNode, target: WoodsNode }, | ||
|
||
{ source: GreatHallNode, target: WoodsNode }, | ||
{ source: WoodsNode, target: MarketNode }, | ||
{ source: MarketNode, target: GreatHallNode }, | ||
{ source: MarketNode, target: TheaterNode }, | ||
{ source: MarketNode, target: WharfNode }, | ||
{ source: WharfNode, target: GraveyardNode }, | ||
], | ||
}; |
Oops, something went wrong.