@inglorious/create-game 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +9 -0
- package/README.md +54 -0
- package/bin/index.js +155 -0
- package/package.json +48 -0
- package/templates/ijs/.prettierrc.yml +6 -0
- package/templates/ijs/.vscode/settings.json +5 -0
- package/templates/ijs/LICENSE +9 -0
- package/templates/ijs/README.md +53 -0
- package/templates/ijs/eslint.config.js +1 -0
- package/templates/ijs/gitignore +48 -0
- package/templates/ijs/index.html +15 -0
- package/templates/ijs/package.json +30 -0
- package/templates/ijs/public/logo.png +0 -0
- package/templates/ijs/public/style.css +36 -0
- package/templates/ijs/src/game.ijs +1 -0
- package/templates/ijs/src/main.js +10 -0
- package/templates/ijs/vite.config.js +15 -0
- package/templates/its/.prettierrc.yml +6 -0
- package/templates/its/.vscode/settings.json +5 -0
- package/templates/its/LICENSE +9 -0
- package/templates/its/README.md +64 -0
- package/templates/its/eslint.config.js +1 -0
- package/templates/its/gitignore +48 -0
- package/templates/its/index.html +15 -0
- package/templates/its/package.json +32 -0
- package/templates/its/public/logo.png +0 -0
- package/templates/its/public/style.css +36 -0
- package/templates/its/src/game.its +1 -0
- package/templates/its/src/main.ts +10 -0
- package/templates/its/tsconfig.json +20 -0
- package/templates/its/vite.config.js +28 -0
- package/templates/js/.prettierrc.yml +1 -0
- package/templates/js/LICENSE +9 -0
- package/templates/js/README.md +29 -0
- package/templates/js/eslint.config.js +1 -0
- package/templates/js/gitignore +49 -0
- package/templates/js/index.html +15 -0
- package/templates/js/package.json +28 -0
- package/templates/js/public/logo.png +0 -0
- package/templates/js/public/style.css +36 -0
- package/templates/js/src/game.js +1 -0
- package/templates/js/src/main.js +10 -0
- package/templates/js/vite.config.js +3 -0
- package/templates/minimal/README.md +10 -0
- package/templates/minimal/gitignore +6 -0
- package/templates/minimal/index.html +37 -0
- package/templates/minimal/public/logo.png +0 -0
- package/templates/minimal/public/style.css +33 -0
- package/templates/minimal/src/game.js +1 -0
- package/templates/ts/.prettierrc.yml +1 -0
- package/templates/ts/LICENSE +9 -0
- package/templates/ts/README.md +30 -0
- package/templates/ts/eslint.config.js +1 -0
- package/templates/ts/gitignore +49 -0
- package/templates/ts/index.html +15 -0
- package/templates/ts/package.json +29 -0
- package/templates/ts/public/logo.png +0 -0
- package/templates/ts/public/style.css +36 -0
- package/templates/ts/src/game.ts +1 -0
- package/templates/ts/src/main.ts +10 -0
- package/templates/ts/tsconfig.json +20 -0
- package/templates/ts/vite.config.js +8 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "its-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "A new game created with @inglorious/create-game",
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --write '**/*.{ts,its}'",
|
|
11
|
+
"lint": "eslint . --ext ts,its --report-unused-disable-directives --max-warnings 0",
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@inglorious/engine": "workspace:*",
|
|
17
|
+
"@inglorious/renderer-2d": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@babel/preset-typescript": "^7.27.1",
|
|
21
|
+
"@inglorious/babel-preset-inglorious-script": "workspace:*",
|
|
22
|
+
"@inglorious/eslint-config": "workspace:*",
|
|
23
|
+
"prettier": "^3.6.2",
|
|
24
|
+
"typescript": "^5.9.2",
|
|
25
|
+
"vite": "^7.1.6",
|
|
26
|
+
"vite-plugin-babel": "^1.3.2"
|
|
27
|
+
},
|
|
28
|
+
"packageManager": "pnpm@10.15.0",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">= 22"
|
|
31
|
+
}
|
|
32
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-family: "Press Start 2P", system-ui;
|
|
7
|
+
width: 100vw;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
margin: 0;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
background-color: #000;
|
|
16
|
+
color: #fff;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
canvas {
|
|
20
|
+
max-width: 1280px;
|
|
21
|
+
max-height: 720px;
|
|
22
|
+
width: 100vw;
|
|
23
|
+
height: auto;
|
|
24
|
+
cursor: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (orientation: landscape) {
|
|
28
|
+
canvas {
|
|
29
|
+
width: auto;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Engine } from "@inglorious/engine/core/engine"
|
|
2
|
+
import { createRenderer } from "@inglorious/renderer-2d"
|
|
3
|
+
|
|
4
|
+
import game from "./game.its"
|
|
5
|
+
|
|
6
|
+
const canvas = document.getElementById("canvas")
|
|
7
|
+
const renderer = createRenderer(canvas)
|
|
8
|
+
const engine = new Engine(renderer, game)
|
|
9
|
+
await engine.init()
|
|
10
|
+
engine.start()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ESNext", "DOM"],
|
|
7
|
+
"moduleResolution": "Bundler",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"allowArbitraryExtensions": true,
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"]
|
|
20
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineConfig } from "vite"
|
|
2
|
+
import babel from "vite-plugin-babel"
|
|
3
|
+
|
|
4
|
+
export default defineConfig({
|
|
5
|
+
// @see https://github.com/vitejs/vite/issues/1973
|
|
6
|
+
define: { "process.env": {} },
|
|
7
|
+
|
|
8
|
+
plugins: [
|
|
9
|
+
babel({
|
|
10
|
+
include: "src/**",
|
|
11
|
+
filter: /\.(js|ijs|ts|its)$/,
|
|
12
|
+
|
|
13
|
+
babelConfig: {
|
|
14
|
+
presets: [
|
|
15
|
+
"@inglorious/inglorious-script",
|
|
16
|
+
[
|
|
17
|
+
"@babel/preset-typescript",
|
|
18
|
+
{
|
|
19
|
+
isTSX: false,
|
|
20
|
+
allExtensions: true,
|
|
21
|
+
onlyRemoveTypeImports: true,
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
],
|
|
25
|
+
},
|
|
26
|
+
}),
|
|
27
|
+
],
|
|
28
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
semi: false
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 Inglorious Coderz Srl.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# js-template
|
|
2
|
+
|
|
3
|
+
This project is a minimal starter template for creating a game with the Inglorious Engine using plain JavaScript and Vite.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This project was scaffolded with `@inglorious/create-game`.
|
|
8
|
+
|
|
9
|
+
To get started, follow these steps:
|
|
10
|
+
|
|
11
|
+
1. **Install dependencies**:
|
|
12
|
+
Navigate to your project directory and install the required packages.
|
|
13
|
+
```sh
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
2. **Start the development server**:
|
|
17
|
+
Run the following command to start the Vite development server.
|
|
18
|
+
```sh
|
|
19
|
+
pnpm dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will start a Vite development server. Open your browser to the local URL provided to see it in action.
|
|
23
|
+
|
|
24
|
+
## Project Setup
|
|
25
|
+
|
|
26
|
+
- `index.html`: The main entry point for your game.
|
|
27
|
+
- `src/`: Contains your game's JavaScript source code.
|
|
28
|
+
- `vite.config.js`: Vite configuration file.
|
|
29
|
+
- `package.json`: Project metadata and dependencies.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@inglorious/eslint-config/browser"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Local env files
|
|
7
|
+
.env
|
|
8
|
+
.env.local
|
|
9
|
+
.env.development.local
|
|
10
|
+
.env.test.local
|
|
11
|
+
.env.production.local
|
|
12
|
+
|
|
13
|
+
# Testing
|
|
14
|
+
coverage
|
|
15
|
+
|
|
16
|
+
# Turbo
|
|
17
|
+
.turbo
|
|
18
|
+
|
|
19
|
+
# Vercel
|
|
20
|
+
.vercel
|
|
21
|
+
|
|
22
|
+
# Build Outputs
|
|
23
|
+
.next/
|
|
24
|
+
out/
|
|
25
|
+
build
|
|
26
|
+
dist
|
|
27
|
+
dist-ssr
|
|
28
|
+
storybook-static
|
|
29
|
+
vite.config.js.timestamp-*
|
|
30
|
+
|
|
31
|
+
# Debug
|
|
32
|
+
logs
|
|
33
|
+
*.log
|
|
34
|
+
npm-debug.log*
|
|
35
|
+
yarn-debug.log*
|
|
36
|
+
yarn-error.log*
|
|
37
|
+
pnpm-debug.log*
|
|
38
|
+
lerna-debug.log*
|
|
39
|
+
|
|
40
|
+
# Editor directories and files
|
|
41
|
+
.vscode/*
|
|
42
|
+
.idea
|
|
43
|
+
.DS_Store
|
|
44
|
+
*.suo
|
|
45
|
+
*.ntvs*
|
|
46
|
+
*.njsproj
|
|
47
|
+
*.sln
|
|
48
|
+
*.sw?
|
|
49
|
+
.qodo
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
|
+
<link rel="stylesheet" href="/style.css" />
|
|
8
|
+
<title>Inglorious Engine - Game</title>
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<canvas id="canvas" width="800" height="600"></canvas>
|
|
13
|
+
<script type="module" src="./src/main.js"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "js-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "A new game created with @inglorious/create-game",
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --write '**/*.js'",
|
|
11
|
+
"lint": "eslint . --ext js --report-unused-disable-directives --max-warnings 0",
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@inglorious/engine": "workspace:*",
|
|
17
|
+
"@inglorious/renderer-2d": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@inglorious/eslint-config": "workspace:*",
|
|
21
|
+
"prettier": "^3.6.2",
|
|
22
|
+
"vite": "^7.1.6"
|
|
23
|
+
},
|
|
24
|
+
"packageManager": "pnpm@10.15.0",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">= 22"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-family: "Press Start 2P", system-ui;
|
|
7
|
+
width: 100vw;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
margin: 0;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
background-color: #000;
|
|
16
|
+
color: #fff;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
canvas {
|
|
20
|
+
max-width: 1280px;
|
|
21
|
+
max-height: 720px;
|
|
22
|
+
width: 100vw;
|
|
23
|
+
height: auto;
|
|
24
|
+
cursor: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (orientation: landscape) {
|
|
28
|
+
canvas {
|
|
29
|
+
width: auto;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Engine } from "@inglorious/engine/core/engine"
|
|
2
|
+
import { createRenderer } from "@inglorious/renderer-2d"
|
|
3
|
+
|
|
4
|
+
import game from "./game.js"
|
|
5
|
+
|
|
6
|
+
const canvas = document.getElementById("canvas")
|
|
7
|
+
const renderer = createRenderer(canvas)
|
|
8
|
+
const engine = new Engine(renderer, game)
|
|
9
|
+
await engine.init()
|
|
10
|
+
engine.start()
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# my-game
|
|
2
|
+
|
|
3
|
+
A new game created with [@inglorious/create-game](https://github.com/Antony-Mistretta/inglorious-engine/tree/main/packages/create-game).
|
|
4
|
+
|
|
5
|
+
This template is a minimal setup for running the Inglorious Engine directly in the browser without any build step.
|
|
6
|
+
|
|
7
|
+
## Getting Started
|
|
8
|
+
|
|
9
|
+
1. Open the `index.html` file in a modern web browser.
|
|
10
|
+
2. Edit the `game.js` file to start building your game!
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/public/logo.png" />
|
|
6
|
+
<link rel="stylesheet" href="/public/style.css" />
|
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
+
|
|
9
|
+
<title>Inglorious Game</title>
|
|
10
|
+
</head>
|
|
11
|
+
|
|
12
|
+
<body>
|
|
13
|
+
<canvas id="canvas"></canvas>
|
|
14
|
+
|
|
15
|
+
<script type="text/javascript">
|
|
16
|
+
window.process = { env: "development" }
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<script type="importmap">
|
|
20
|
+
{
|
|
21
|
+
"imports": {
|
|
22
|
+
"mutative": "https://unpkg.com/mutative@latest/dist/mutative.esm.mjs",
|
|
23
|
+
"@inglorious/utils/": "https://unpkg.com/@inglorious%2Futils@latest/src/",
|
|
24
|
+
"@inglorious/store/": "https://unpkg.com/@inglorious%2Fstore@latest/src/",
|
|
25
|
+
"@inglorious/engine/": "https://unpkg.com/@inglorious%2Fengine@latest/src/",
|
|
26
|
+
"@inglorious/renderer-2d/": "https://unpkg.com/@inglorious%2Frenderer-2d@latest/src/",
|
|
27
|
+
"game": "/src/game.js"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<script
|
|
33
|
+
type="module"
|
|
34
|
+
src="https://unpkg.com/@inglorious%2Fengine@latest/src/main.js"
|
|
35
|
+
></script>
|
|
36
|
+
</body>
|
|
37
|
+
</html>
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
width: 100vw;
|
|
7
|
+
height: 100vh;
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
margin: 0;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
align-items: center;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
canvas {
|
|
17
|
+
max-width: 800px;
|
|
18
|
+
max-height: 600px;
|
|
19
|
+
width: 100vw;
|
|
20
|
+
height: auto;
|
|
21
|
+
cursor: none;
|
|
22
|
+
|
|
23
|
+
@media (orientation: landscape) {
|
|
24
|
+
canvas {
|
|
25
|
+
width: auto;
|
|
26
|
+
height: 100vh;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
img {
|
|
32
|
+
display: none;
|
|
33
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
semi: false
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright © 2025 Inglorious Coderz Srl.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# ts-template
|
|
2
|
+
|
|
3
|
+
This project is a minimal starter template for creating a game with the Inglorious Engine using TypeScript and Vite.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
This project was scaffolded with `@inglorious/create-game`.
|
|
8
|
+
|
|
9
|
+
To get started, follow these steps:
|
|
10
|
+
|
|
11
|
+
1. **Install dependencies**:
|
|
12
|
+
Navigate to your project directory and install the required packages.
|
|
13
|
+
```sh
|
|
14
|
+
pnpm install
|
|
15
|
+
```
|
|
16
|
+
2. **Start the development server**:
|
|
17
|
+
Run the following command to start the Vite development server.
|
|
18
|
+
```sh
|
|
19
|
+
pnpm dev
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
This will start a Vite development server. Open your browser to the local URL provided to see it in action.
|
|
23
|
+
|
|
24
|
+
## Project Setup
|
|
25
|
+
|
|
26
|
+
- `index.html`: The main entry point for your game.
|
|
27
|
+
- `src/`: Contains your game's TypeScript source code.
|
|
28
|
+
- `vite.config.js`: Vite configuration file.
|
|
29
|
+
- `tsconfig.json`: TypeScript configuration for the project.
|
|
30
|
+
- `package.json`: Project metadata and dependencies.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@inglorious/eslint-config/browser"
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Dependencies
|
|
2
|
+
node_modules
|
|
3
|
+
.pnp
|
|
4
|
+
.pnp.js
|
|
5
|
+
|
|
6
|
+
# Local env files
|
|
7
|
+
.env
|
|
8
|
+
.env.local
|
|
9
|
+
.env.development.local
|
|
10
|
+
.env.test.local
|
|
11
|
+
.env.production.local
|
|
12
|
+
|
|
13
|
+
# Testing
|
|
14
|
+
coverage
|
|
15
|
+
|
|
16
|
+
# Turbo
|
|
17
|
+
.turbo
|
|
18
|
+
|
|
19
|
+
# Vercel
|
|
20
|
+
.vercel
|
|
21
|
+
|
|
22
|
+
# Build Outputs
|
|
23
|
+
.next/
|
|
24
|
+
out/
|
|
25
|
+
build
|
|
26
|
+
dist
|
|
27
|
+
dist-ssr
|
|
28
|
+
storybook-static
|
|
29
|
+
vite.config.js.timestamp-*
|
|
30
|
+
|
|
31
|
+
# Debug
|
|
32
|
+
logs
|
|
33
|
+
*.log
|
|
34
|
+
npm-debug.log*
|
|
35
|
+
yarn-debug.log*
|
|
36
|
+
yarn-error.log*
|
|
37
|
+
pnpm-debug.log*
|
|
38
|
+
lerna-debug.log*
|
|
39
|
+
|
|
40
|
+
# Editor directories and files
|
|
41
|
+
.vscode/*
|
|
42
|
+
.idea
|
|
43
|
+
.DS_Store
|
|
44
|
+
*.suo
|
|
45
|
+
*.ntvs*
|
|
46
|
+
*.njsproj
|
|
47
|
+
*.sln
|
|
48
|
+
*.sw?
|
|
49
|
+
.qodo
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<link rel="icon" type="image/svg+xml" href="/logo.png" />
|
|
7
|
+
<link rel="stylesheet" href="/style.css" />
|
|
8
|
+
<title>Inglorious Engine - Game</title>
|
|
9
|
+
</head>
|
|
10
|
+
|
|
11
|
+
<body>
|
|
12
|
+
<canvas id="canvas" width="800" height="600"></canvas>
|
|
13
|
+
<script type="module" src="./src/main.js"></script>
|
|
14
|
+
</body>
|
|
15
|
+
</html>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "ts-template",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"private": true,
|
|
6
|
+
"description": "A new game created with @inglorious/create-game",
|
|
7
|
+
"author": "",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --write '**/*.ts'",
|
|
11
|
+
"lint": "eslint . --ext ts --report-unused-disable-directives --max-warnings 0",
|
|
12
|
+
"dev": "vite",
|
|
13
|
+
"build": "vite build"
|
|
14
|
+
},
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@inglorious/engine": "workspace:*",
|
|
17
|
+
"@inglorious/renderer-2d": "workspace:*"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@inglorious/eslint-config": "workspace:*",
|
|
21
|
+
"prettier": "^3.6.2",
|
|
22
|
+
"typescript": "^5.9.2",
|
|
23
|
+
"vite": "^7.1.6"
|
|
24
|
+
},
|
|
25
|
+
"packageManager": "pnpm@10.15.0",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">= 22"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
* {
|
|
2
|
+
box-sizing: border-box;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
body {
|
|
6
|
+
font-family: "Press Start 2P", system-ui;
|
|
7
|
+
width: 100vw;
|
|
8
|
+
height: 100vh;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
margin: 0;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
align-items: center;
|
|
15
|
+
background-color: #000;
|
|
16
|
+
color: #fff;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
canvas {
|
|
20
|
+
max-width: 1280px;
|
|
21
|
+
max-height: 720px;
|
|
22
|
+
width: 100vw;
|
|
23
|
+
height: auto;
|
|
24
|
+
cursor: none;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@media (orientation: landscape) {
|
|
28
|
+
canvas {
|
|
29
|
+
width: auto;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
img {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default {}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Engine } from "@inglorious/engine/core/engine"
|
|
2
|
+
import { createRenderer } from "@inglorious/renderer-2d"
|
|
3
|
+
|
|
4
|
+
import game from "./game.ts"
|
|
5
|
+
|
|
6
|
+
const canvas = document.getElementById("canvas")
|
|
7
|
+
const renderer = createRenderer(canvas)
|
|
8
|
+
const engine = new Engine(renderer, game)
|
|
9
|
+
await engine.init()
|
|
10
|
+
engine.start()
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"useDefineForClassFields": true,
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"lib": ["ESNext", "DOM"],
|
|
7
|
+
"moduleResolution": "Bundler",
|
|
8
|
+
"strict": true,
|
|
9
|
+
"resolveJsonModule": true,
|
|
10
|
+
"isolatedModules": true,
|
|
11
|
+
"esModuleInterop": true,
|
|
12
|
+
"noEmit": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"allowArbitraryExtensions": true,
|
|
17
|
+
"skipLibCheck": true
|
|
18
|
+
},
|
|
19
|
+
"include": ["src"]
|
|
20
|
+
}
|