Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
3bb8e4f
Add color to grid
extremebip Dec 23, 2023
082b62a
Add click handler and refactor renderer
extremebip Dec 24, 2023
dbca714
Add number rendering in grid
extremebip Jan 6, 2024
276bd0e
Add initial rendering & basic re-rendering with event
extremebip Jan 12, 2024
dfc160c
Patch multiple click on active tile cause it to be inactive
extremebip Mar 9, 2024
3d6e945
Patch duplicate tile rendered on active tile
extremebip Mar 9, 2024
daae02a
Refactor renderer to handle multiple selected tiles
extremebip Mar 11, 2024
c0e5274
Add tile movement system
extremebip Mar 11, 2024
f6af0b9
Reset projects
extremebip Jun 13, 2024
bf8580f
Init project
extremebip Jun 13, 2024
aa6becf
Init App & Game code
extremebip Jun 15, 2024
4dc3157
Add simple grid rendering
extremebip Jun 15, 2024
b796067
Change board orientation config
extremebip Jun 17, 2024
47d6d8c
Add movable character
extremebip Jun 17, 2024
b84dc1f
Add roadmap into notes
extremebip Jun 19, 2024
ba01e30
Simplify player hex scaling calculation
extremebip Jun 19, 2024
c60500a
Refactor board tiles into 1D & create player type
extremebip Jun 19, 2024
7c5fb9a
Add number absorption with player movement
extremebip Jun 19, 2024
bab0a8b
Convert entire hex coordinate into cube coordinate
extremebip Jun 25, 2024
c6e1211
Add multiplayers with movement
extremebip Nov 3, 2024
1bdd449
Refactor move player into a controller
extremebip Nov 24, 2024
b03bf3e
Add fighting mechanic & win condition
extremebip Dec 7, 2024
deb3a6c
Init Unit Class & States for Multiple Units
extremebip Dec 8, 2024
d29e92a
Add debug panel & ClientState
extremebip Dec 8, 2024
ddbec45
Add move unit by click handler
extremebip Apr 3, 2025
f2c3d2e
Add unit re-renderer + logic for colors
extremebip Apr 3, 2025
eb4853c
Add end of turn button & event handling
extremebip Apr 3, 2025
2561184
Add multi unit fighting mechanic
extremebip Apr 5, 2025
0efa4df
Refactor App units from array to map
extremebip Apr 5, 2025
2c61634
Refactor selection & movement over dead unit
extremebip Apr 5, 2025
eecbe6d
Re-enable game over message
extremebip Apr 5, 2025
69a4235
Init renderer class
extremebip Apr 8, 2025
ac6db4b
Finish Renderer.ts
Phobez Apr 10, 2025
d3fb640
Connect App and Renderer
Phobez Apr 11, 2025
a889aba
Add event, handler types + base render classes
extremebip Apr 12, 2025
0a73023
Add missing this to unit displayPower()
extremebip Apr 12, 2025
219be1c
Add addSubscribers calling from entity constructor
extremebip Apr 12, 2025
2016c4d
Add Map tile class
extremebip Apr 12, 2025
e0a4c8a
Move main App into bak
extremebip Apr 12, 2025
fe88fd4
Add initial map generator
extremebip Apr 12, 2025
68d82e4
Add initial unit generator
extremebip Apr 12, 2025
b2bdb26
Readjust click handler + selecting event
extremebip Apr 13, 2025
5f125d1
Refactor types naming
extremebip May 31, 2025
f91ced2
Refactor client-server communication + movement system
extremebip May 31, 2025
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
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 3
trim_trailing_whitespace = true

[.html]
indent_size = 2
18 changes: 18 additions & 0 deletions colors.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"grid": {
"background": "#000",
"primary": "#0d6efd"
},
"unit": {
"red": {
"primary": "#c40000",
"active": "#ff6868",
"disabled": "#ff686880"
},
"blue": {
"primary": "#4e90e6",
"active": "#71afff",
"disabled": "#71afff80"
}
}
}
10 changes: 10 additions & 0 deletions gameConfig.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Orientation } from "honeycomb-grid";

export default {
hex: {
dimensions: 30,
origin: "topLeft",
orientation: Orientation.FLAT,
},
fps: 30,
} as const;
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
<title>Battle Simulator</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/main.js"></script>
<div style="display: flex; flex: 1;">
<div id="game">
<p id="game-over-text"></p>
<button id="end-turn-button">End Turn</button>
</div>
<div id="debug-panel" style="border: 1px solid black; padding: 0.25rem; min-width: 50vw;"></div>
</div>
<script type="module" src="/src/App.ts"></script>
</body>
</html>
23 changes: 0 additions & 23 deletions main.js

This file was deleted.

28 changes: 28 additions & 0 deletions notes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Playground Roadmap

1. [x] Init project with boardgame.io & PIXI.js.
2. [x] Create the board with numbers.
3. [x] Add player and movement.
4. [x] Add multiplayer and win condition (technical back-end).
5. [ ] Add multiple units for each player.
6. [ ] Add icon
7. [ ] Represent powers into HP bar (?)
8. [ ] Push playground into main.

Multiple Units
Logic:
1. Select which unit to move
1. Must be your own unit
2. Must not do an action before
2. Mark the unit as selected in the client
3. Execute an action for the unit
1. Move
2. Fight
4. Mark the unit as "done" (already done an action)
5. Loop to (1) until all units have completed an action
6. End Turn, go to another player

Low Level Logic:
1. Select unit to move
- Set unit ID to activeUnitID
2.
Loading