Skip to content

Commit cf9e8b1

Browse files
authored
Merge branch 'main' into feat/map-border-anims
2 parents 06313f8 + c20b271 commit cf9e8b1

File tree

6 files changed

+61
-60
lines changed

6 files changed

+61
-60
lines changed

CHANGELOG.md

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,25 @@ All notable changes to this project will be documented in this file. Dates are d
44

55
Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
66

7+
#### [v0.23.0](https://github.com/oskarrough/slaytheweb/compare/v0.22.3...v0.23.0)
8+
9+
- Update linting [`#263`](https://github.com/oskarrough/slaytheweb/pull/263)
10+
- Deck builder editor feature [`#259`](https://github.com/oskarrough/slaytheweb/pull/259)
11+
- Feat/middle of screen [`#262`](https://github.com/oskarrough/slaytheweb/pull/262)
12+
- Fix being able to upgrade cards twice (to no effect) in campfire rooms [`#260`](https://github.com/oskarrough/slaytheweb/pull/260)
13+
- Remove service worker again [`#254`](https://github.com/oskarrough/slaytheweb/pull/254)
14+
- Replace tone.js with web audio [`#252`](https://github.com/oskarrough/slaytheweb/pull/252)
15+
- Refactor deck logic [`d69170c`](https://github.com/oskarrough/slaytheweb/commit/d69170cb7accbb95147b3b84d508ec93728b3c36)
16+
- Add local storage deck editing [`cdbc929`](https://github.com/oskarrough/slaytheweb/commit/cdbc9290581bd9f874a97511f5d8c7385f0ead6e)
17+
- Clean up [`ff59fbf`](https://github.com/oskarrough/slaytheweb/commit/ff59fbfdbbb6762d68c497188698a6c47b7e9297)
18+
719
#### [v0.22.3](https://github.com/oskarrough/slaytheweb/compare/v0.22.2...v0.22.3)
820

9-
- Rewording on splash page [`bdc9378`](https://github.com/oskarrough/slaytheweb/commit/bdc93786596c8200c1e0a006db672997d04e701f)
10-
- Possible map async render error fix [`6cb9aaa`](https://github.com/oskarrough/slaytheweb/commit/6cb9aaa0f32e2f8834e856f53f850db7bc8e602f)
11-
- Merge pull request #251 from oskarrough/2025-february [`51a5280`](https://github.com/oskarrough/slaytheweb/commit/51a5280a4355d88ae619a14e5903ac1b07041759)
21+
> 26 February 2025
22+
23+
- Type the minified game state used in the backend [`73656be`](https://github.com/oskarrough/slaytheweb/commit/73656bef656dfe81837c04b507b07f5d5b1bbfc2)
24+
- Add more tests for card creation [`cc17802`](https://github.com/oskarrough/slaytheweb/commit/cc17802db7f9b75293998c8d48689745d1199c81)
25+
- Release 0.22.3 [`8f622d3`](https://github.com/oskarrough/slaytheweb/commit/8f622d373c6318a2edfba3e967768c224a20065f)
1226

1327
#### [v0.22.2](https://github.com/oskarrough/slaytheweb/compare/v0.22.1...v0.22.2)
1428

DOCUMENTATION.md

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,52 @@ Throughout the project I've attempted to document and leave comments. Go ahead a
55
In the root of this project you'll find configuration files as well as three folders:
66

77
- [src →](src/) The web root.
8+
- [content](src/content) contains cards, dungeons, encounters and monsters etc.
89
- [game](src/game) contains the core game logic
9-
- [content](src/content) uses methods from the game engine to build cards, dungeon and monsters
1010
- [ui](src/ui) is the example web interface to actually play the game
1111
- [public →](public/) Copied to the web root as-is
1212
- [tests →](tests/) Contains all tests for the game engine. Nothing for the UI. Run `npm test`.
1313

14-
## Src
14+
## Coding style
1515

16-
This is the full source code of the game _and_ UI. The game logic does not concern with the UI.
16+
- JavaScript (ES modules)
17+
- Web components and Preact HTM for rendering
18+
- Immer for immutable state updates
19+
- Error handling: Use try/catch sparingly; prefer validation and early returns
20+
- JSDoc for documentation
21+
- No semicolons, single quotes, tabs
1722

1823
### Game
1924

2025
#### Game State
2126

22-
The full game state is always stored in a single, large "game state" object. It is everything needed to reproduce a certain state of the game. Everything is synchronous. It does not care about your UI. The state is always modified using "actions".
27+
The full game state is always stored in a single, large "game state" object. It is everything needed to reproduce a certain state of the game. It does not know about your UI. The state is modified using synchronous "actions".
2328

2429
#### Actions
2530

2631
An action is a function that takes a `state` object, modifies it, and returns a new one. There are actions for drawing a card, dealing damage, applying a debuff... everything you want to do, there's an action.
2732

28-
See all actions in [actions.js](src/game/actions.js). Most have comments and corresponding tests you can check.
33+
See all (mostly well documented) actions in [actions.js](src/game/actions.js).
2934

3035
#### Action Manager
3136

32-
As said, actions return a new state. They don't modify the original state. To keep track of all the moves (actions) made, we use the "action manager" to queue and dequeue them.
37+
As said, actions return a new state. To keep track of actions made, we use an "action manager" to queue and dequeue them.
3338

3439
Run `enqueue(action)` to add an action to the list.
3540
Run `dequeue()` to update the state with the changes from the oldest action in the queue.
3641

37-
> Note, you don't pass an action directly to the action manager. Rather you pass an object. Like this: `{type: 'nameOfAction', damage: 5, ... more properties}`.
42+
> Note, you don't pass an action directly to the action manager. Rather you pass a description, like so: `{type: 'nameOfAction', damage: 5, ... more properties}`.
3843
3944
#### Cards
4045

41-
You have a deck of cards. Cards have different energy cost and can trigge other game actions when they are played.
46+
You have a deck of cards. Cards have energy cost, have target(s), can deal damage and block, trigger game actions, apply powers (de/buffs) when played and have conditions that decide when they can be played.
4247

43-
1. Cards start in the "draw pile".
44-
2. From there they are drawn to the "hand"
45-
3. ...and finally, once played, to the "discard pile".
48+
Cards move from the "draw pile" into your hand, and once played to the discard pile.
4649

47-
Once the draw pile is empty, and you attempt to draw, the discard pile is reshuffled into the draw pile.
50+
If the draw pile has fewer cards than you attempt to draw, the discard pile is shuffled into the draw pile.
4851

4952
Cards also have a `target` property to suggest which targets the card should affect.
5053

51-
For more advanced cards, you can define (custom) actions to run when the card is played. To limit when a a card can be played, use "conditions" (see the source code).
52-
5354
#### Powers
5455

5556
Cards can apply "powers". A power is a status effect or aura that usually lasts one or more turns. It can target the player, a monster or all enemies. A power could do literally anything, but an example is the "Vulnerable" power, which makes the target take 50% more damage for two turns.

README.md

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,57 @@
11
# Slay the Web
22

3-
A digital, single player deckbuilding roguelike card game for the web based on Slay The Spire,
3+
A single player deck-building roguelike video card game for the web based on Slay The Spire,
44
a fantastic video game designed by [MegaCrit](https://www.megacrit.com/).
55

6+
### [Play on slaytheweb.cards](https://slaytheweb.cards/)
67

7-
### [Play on slaytheweb.cards](https://slaytheweb.cards/)
88
### [Chat on #slaytheweb:matrix.org](https://matrix.to/#/#slaytheweb:matrix.org)
99

1010
<a href="https://slaytheweb.cards"><img src="https://i.imgur.com/m9CRCsa.png" alt="Screenshot of Slay the Web" width="640"></a>
1111

12+
## Background
13+
1214
After many runs in the Spire, I got into the theory behind the game. Inspired by the STS modding community, I thought it'd be fun and a great learning experience to try and implement the core logic of the game in JavaScript for the web. And that is what _Slay the Web_ is: a kind of stable, UI agnostic game engine with an example UI for the web.
1315

14-
## State of the game
16+
## Updates
1517

16-
December 2023. The core mechanics seem to work. There is a [dynamic map](https://slaytheweb.cards/map-demo) you can navigate with different rooms and monsters. You can fight against them using your cards and their powers.
18+
See the CHANGELOG.md file.
1719

18-
There are many things that would make it more fun to play:
20+
## Development
1921

20-
- new cards
21-
- new powers
22-
- more monsters
23-
- expand the map into multiple "worlds" (or acts...)
24-
- better UI and animations
25-
- optimize UI for mobile
22+
TLDR;
23+
24+
1. Clone the repository
25+
2. Run `npm install` followed by `npm run dev` to open a local development server.
2626

27-
See the [open issues](https://github.com/oskarrough/slaytheweb/issues). Have an idea? Please [open a new issue](https://github.com/oskarrough/slaytheweb/issues/new).
2827

2928
## Documentation
3029

3130
If you're interested in contributing to the game or merely curious how it works:
3231

3332
- [The documentation](DOCUMENTATION.md)
3433

35-
Or browse the code. Especially the game logic includes tons of comments (written in JSDoc).
34+
Or browse the code. Especially the game logic includes tons of comments.
3635

37-
## Development
36+
See the [open issues](https://github.com/oskarrough/slaytheweb/issues).
37+
Have an idea? Please [open a new issue](https://github.com/oskarrough/slaytheweb/issues/new).
3838

39-
TLDR;
40-
41-
1. Clone the repository
42-
2. Run `npm install` followed by `npm run dev` to open a local development server.
43-
44-
The `src/game` folder contains the actual game logic.
45-
The `src/ui` folder is the website UI where you can actually play the game.
46-
The `src/content` folder builds content for the game.
47-
48-
### Coding style
49-
50-
- JavaScript (ES modules)
51-
- JSDoc for documentation
52-
- No semicolons, single quotes, tabs
53-
- Error handling: Use try/catch sparingly; prefer validation and early returns
54-
55-
## Architecture
56-
- `src/game/` - Core game logic
57-
- `src/content/` - Game content definition (cards, encounters)
58-
- `src/ui/` - Frontend components and UI logic
59-
- Use Preact/HTM for components, Immer for immutable state updates
39+
There are many areas that would make it more fun to play:
6040

41+
- new cards
42+
- new powers
43+
- more monsters
44+
- expand the map into multiple "worlds" (or acts...)
45+
- better UI and animations
46+
- optimize UI for mobile
6147

6248
## How to release a new version (aka deploy)
6349

64-
Every commit to the `main` branch automatically deploys to https://slaytheweb.cards via the Vercel service.
50+
Every commit to the `main` branch automatically deploys to https://slaytheweb.cards via the Vercel service.
6551

66-
If you open a PR, it'll give you a preview URL as well for testing.
52+
If you open a PR, it'll give you a preview URL where we can see if things are as expected.
6753

68-
To update `CHANGELOG.md`, run `bunx release-it` and follow the prompts. We do not use GitHub releases.
54+
To update the `CHANGELOG.md`, run `bun run release` and follow the prompts. We do not use GitHub releases.
6955

7056
## References
7157

@@ -100,7 +86,7 @@ To update `CHANGELOG.md`, run `bunx release-it` and follow the prompts. We do no
10086
- https://en.wikipedia.org/wiki/Slay_the_Spire
10187
- https://slay-the-spire.fandom.com/wiki/Slay_the_Spire_Wiki
10288
- https://spirelogs.com/
103-
- https://maybelatergames.co.uk/tools/slaythespire/
89+
- https://maybelatergames.co.uk/tools/slaythespire/
10490
- https://github.com/daviscook477/BaseMod
10591
- https://github.com/Gremious/StS-DefaultModBase
10692
- https://github.com/Gremious/StS-DefaultModBase/wiki
@@ -124,7 +110,7 @@ Licenced from https://mbtype.com/
124110
### Open source artwork
125111

126112
- http://ronenness.github.io/RPGUI/
127-
- https://github.com/game-icons/icons
113+
- https://github.com/game-icons/icons
128114
- https://www.fromoldbooks.org/
129115
- https://www.oldbookart.com/
130116

bun.lockb

0 Bytes
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "slaytheweb",
3-
"version": "0.22.3",
3+
"version": "0.23.0",
44
"license": "AGPL-3.0-or-later",
55
"homepage": "https://slaytheweb.cards",
66
"repository": "https://github.com/oskarrough/slaytheweb",

src/ui/components/splash-screen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ export default class SplashScreen extends Component {
7171
${location.hash
7272
? html`
7373
<li>Found a saved game. <button autofocus onClick=${this.props.onContinue}>Continue?</button></li>
74-
<li><button onClick=${this.props.onNewGame}>New Game</a></li>
74+
<li><button onClick=${() => this.props.onNewGame()}>New Game</button></li>
7575
`
7676
: html`
77-
<li><button autofocus onClick=${this.props.onNewGame}>Play</button></li>
77+
<li><button autofocus onClick=${() => this.props.onNewGame()}>Play</button></li>
7878
<li><button onClick=${this.startDeckSelection}>Custom Game</button></li>
7979
<li><hr /></li>
8080
<li><a class="Button" href="/?debug&tutorial">Tutorial</a></li>

0 commit comments

Comments
 (0)