Skip to content

Commit

Permalink
feat: flesh in game engine
Browse files Browse the repository at this point in the history
  • Loading branch information
hxtree committed Dec 11, 2024
1 parent 847b774 commit 4c39983
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 128 deletions.
12 changes: 12 additions & 0 deletions clients/player-client/src/core/GameEngine/GameEngine.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React from 'react';

export type GameEngineProps = {
data: any;
updateData: (newData: any) => void;
};

export const GameEngine: React.FC<GameEngineProps> = () => {
// if input up then try to move up

return null;
};
124 changes: 0 additions & 124 deletions clients/player-client/src/pages/game-state.json

This file was deleted.

13 changes: 12 additions & 1 deletion clients/player-client/src/pages/home.page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import React, { useState } from 'react';
import { IsometricCanvas, IsometricCanvasProps } from '../core/IsometricCanvas';
import gameState from './game-state.json';
import gameState from './data/Sewer.json';
import { InputProvider } from '../context/Input/InputProvider';
import { Keyboard } from '../core/Keyboard/Keyboard';
import { GameEngine } from '../core/GameEngine/GameEngine';

export default function HomePage() {
const [gameData, setGameData] = useState({ input: '', playerPosition: 0 });

const updateGameData = (newData: any) => {
setGameData(newData);
};

return (
<InputProvider>
<Keyboard />
<GameEngine data={gameData} updateData={updateGameData} />

{/** TODO use gameData={gameData} */}
{/* @ts-expect-error needed for types temp */}
<IsometricCanvas {...(gameState as IsometricCanvasProps)} />
</InputProvider>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@galaxyops/create-artifact",
"version": "4.2.0",
"version": "4.3.0",
"license": "MIT",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down Expand Up @@ -28,7 +28,7 @@
"@pnpm/find-workspace-dir": "~6.0.3"
},
"devDependencies": {
"@galaxyops/eslint-config": "3.1.1",
"@galaxyops/eslint-config": "3.2.0",
"eslint": "8.57.0",
"@pnpm/types": "^8.5.0",
"@types/fs-extra": "^9.0.13",
Expand All @@ -39,6 +39,6 @@
"@types/archiver": "~5.3.2",
"@types/jest": "29.5.12",
"jest": "29.7.0",
"@galaxyops/base-nodejs": "0.1.0"
"@galaxyops/base-nodejs": "0.2.0"
}
}

0 comments on commit 4c39983

Please sign in to comment.