create-asciitorium 0.1.34 → 0.1.36

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.
Files changed (46) hide show
  1. package/README.md +4 -4
  2. package/dist/index.js +2 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/templates/base/index.html +1 -1
  5. package/dist/templates/base/package.json +1 -1
  6. package/dist/templates/base/public/art/ART-DESIGN-SPEC.md +375 -0
  7. package/dist/templates/base/public/art/README.md +115 -0
  8. package/dist/templates/base/public/art/asciitorium.art +111 -0
  9. package/dist/templates/base/public/art/borders/bubbles.art +16 -0
  10. package/dist/templates/base/public/art/borders/dna.art +9 -0
  11. package/dist/templates/base/public/art/castle.art +4 -0
  12. package/dist/templates/base/public/art/computer.art +17 -0
  13. package/dist/templates/base/public/art/font/pencil.art +168 -0
  14. package/dist/templates/base/public/art/maps/README.md +251 -0
  15. package/dist/templates/base/public/art/maps/example/README.md +62 -0
  16. package/dist/templates/base/public/art/maps/example/legend.json +29 -0
  17. package/dist/templates/base/public/art/maps/example/map.art +21 -0
  18. package/dist/templates/base/public/art/materials/README.md +279 -0
  19. package/dist/templates/base/public/art/materials/bone.art +11 -0
  20. package/dist/templates/base/public/art/materials/door-wooden.art +154 -0
  21. package/dist/templates/base/public/art/materials/wall-brick.art +128 -0
  22. package/dist/templates/base/public/art/materials/wall-wireframe.art +128 -0
  23. package/dist/templates/base/public/art/mazes/example.art +21 -0
  24. package/dist/templates/base/public/art/sounds/door-close.mp3 +0 -0
  25. package/dist/templates/base/public/art/sounds/door-open.mp3 +0 -0
  26. package/dist/templates/base/public/art/sounds/taps.mp3 +0 -0
  27. package/dist/templates/base/public/art/sprites/asciitorium.art +6 -0
  28. package/dist/templates/base/public/art/sprites/balloon.art +126 -0
  29. package/dist/templates/base/public/art/sprites/beating-heart.art +49 -0
  30. package/dist/templates/base/public/art/sprites/castle.art +4 -0
  31. package/dist/templates/base/public/art/sprites/component-icon.art +6 -0
  32. package/dist/templates/base/public/art/sprites/eyes.art +61 -0
  33. package/dist/templates/base/public/art/sprites/firework.art +58 -0
  34. package/dist/templates/base/public/art/sprites/heart.art +5 -0
  35. package/dist/templates/base/public/art/sprites/multi-select-test.art +6 -0
  36. package/dist/templates/base/public/art/sprites/nav-basics.art +5 -0
  37. package/dist/templates/base/public/art/sprites/pyramid.art +5 -0
  38. package/dist/templates/base/public/art/sprites/tatooene.art +5 -0
  39. package/dist/templates/base/public/art/sprites/welcome.art +7 -0
  40. package/dist/templates/base/public/art/tatooene.txt +5 -0
  41. package/dist/templates/base/public/index.css +41 -0
  42. package/dist/templates/base/public/logo.png +0 -0
  43. package/dist/templates/base/scripts/gen-figlet-art.js +2 -2
  44. package/dist/templates/base/scripts/map-builder.js +294 -0
  45. package/dist/templates/base/src/main.tsx +22 -79
  46. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ __,:,__ __,:
2
+ ,ad88P`Y88ba, ,ad88P`
3
+ ad88888' `88888ba ad88888'
4
+ ,d88888P' `Y88888b, ,d88888P'
5
+ ,d888P"' `"Y888b,d888P"'
6
+ :([" ``":"''
7
+ `Y88ba,
8
+ `88888ba
9
+ `Y88888b,
10
+ `"Y888b,
11
+ "]):
12
+ ,ad88P'
13
+ ad88888'
14
+ ,d88888P'
15
+ ,d888P"'
16
+ :(["
@@ -0,0 +1,9 @@
1
+ .--. .--. .--. .--. .--. .--. .--. .--.
2
+ /.::.\˙::˙/.::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\::::::::.\
3
+ ::. `--’ `--’ `--’ `--’ `--’ `--’ `--’ `
4
+ ::)
5
+ ::’
6
+ ’/
7
+ .::
8
+ (::
9
+ `\:
@@ -0,0 +1,4 @@
1
+ █▄█▄█ █▄█▄█
2
+ █▄█▄█▄█▄█▐█┼█▌█▄█▄█▄█▄█▐█┼█▌█▄█▄█▄█▄█
3
+ ███┼██┼██▐███▌█┼█╔═╗█┼█▐███▌███┼█████
4
+ █████████▐███▌███║▓║███▐███▌█████████
@@ -0,0 +1,17 @@
1
+ _____________________
2
+ / ` \
3
+ | .-----------. | |-----.
4
+ | | | | |-=---|
5
+ | | | | |-----|
6
+ | | | | |-----|
7
+ | | | | |-----|
8
+ | `-----------' | |-----'/\
9
+ \________________/___' / \
10
+ / / / /
11
+ / // // / / /
12
+ / / / /
13
+ / _/_/_/_/_/_/_/_/_/_/ / /
14
+ / _/_/_/_/_/_/_/_/_/_/ / /
15
+ / _/_/_/_______/_/_/_/ / __/
16
+ /______________________/ /
17
+ \______________________\/
@@ -0,0 +1,168 @@
1
+ § {"kind":"font"}
2
+ ¶ {"character":"a"}
3
+
4
+ ╭─╮
5
+ ╭─┤
6
+ ╰─╰
7
+
8
+ ¶ {"character":"b"}
9
+
10
+ ├─╮
11
+ │ │
12
+ ╯─╯
13
+
14
+ ¶ {"character":"c"}
15
+
16
+ ╭─╮
17
+
18
+ ╰─╯
19
+
20
+ ¶ {"character":"d"}
21
+
22
+ ╭─┤
23
+ │ │
24
+ ╰─╰
25
+
26
+ ¶ {"character":"e"}
27
+
28
+ ╭─╮
29
+ ├─╯
30
+ ╰─╯
31
+
32
+ ¶ {"character":"f"}
33
+ ╭─
34
+ ├─
35
+
36
+
37
+
38
+ ¶ {"character":"g"}
39
+
40
+
41
+ ╭─╮
42
+ ╰─┤
43
+ ╰─╯
44
+ ¶ {"character":"h"}
45
+
46
+
47
+ ├─╮
48
+ ╵ ╵
49
+
50
+ ¶ {"character":"i"}
51
+
52
+
53
+
54
+
55
+
56
+ ¶ {"character":"j"}
57
+
58
+
59
+
60
+
61
+ ╰─╯
62
+ ¶ {"character":"k"}
63
+
64
+ │╱
65
+ ├╮
66
+ ╵╵
67
+
68
+ ¶ {"character":"l"}
69
+
70
+
71
+
72
+
73
+
74
+ ¶ {"character":"m"}
75
+
76
+ ╭─┬─╮
77
+ │ │ │
78
+ ╵ ╵ ╵
79
+
80
+ ¶ {"character":"n"}
81
+
82
+ ┌─╮
83
+ │ │
84
+ ╵ ╵
85
+
86
+ ¶ {"character":"o"}
87
+
88
+ ╭─╮
89
+ │ │
90
+ ╰─╯
91
+
92
+ ¶ {"character":"p"}
93
+
94
+ ╭─╮
95
+ │ │
96
+ ├─╯
97
+
98
+ ¶ {"character":"q"}
99
+
100
+ ╭─╮
101
+ │ │
102
+ ╰─┤
103
+
104
+ ¶ {"character":"r"}
105
+
106
+ ╭─╮
107
+
108
+
109
+
110
+ ¶ {"character":"s"}
111
+
112
+ ╭─╮
113
+ ╰─╮
114
+ ╰─╯
115
+
116
+ ¶ {"character":"t"}
117
+
118
+ ╶┼╴
119
+
120
+
121
+
122
+ ¶ {"character":"u"}
123
+
124
+ ╷ ╷
125
+ │ │
126
+ ╰─┘
127
+
128
+ ¶ {"character":"v"}
129
+
130
+
131
+ \ /
132
+ V
133
+
134
+ ¶ {"character":"w"}
135
+
136
+
137
+ │ ╷ │
138
+ ╰─┴─╯
139
+
140
+ ¶ {"character":"x"}
141
+
142
+
143
+ ╲╱
144
+ ╱╲
145
+
146
+ ¶ {"character":"y"}
147
+
148
+
149
+ ╷ ╷
150
+ ╰─┤
151
+ ─╯
152
+
153
+ ¶ {"character":"z"}
154
+
155
+ ──╮
156
+
157
+ ╰──
158
+
159
+ ¶ {"character":"!"}
160
+
161
+
162
+
163
+
164
+ ¶ {"character":"W"}
165
+ ╷ ╷
166
+ │ ╷ │
167
+ │ │ │
168
+ ╰─┴─╯
@@ -0,0 +1,251 @@
1
+ # Maps Directory
2
+
3
+ This directory contains map layouts and legends for game environments in asciitorium. Maps are typically stored as text files with ASCII characters representing different terrain types, while legend files (JSON format) define what each character represents.
4
+
5
+ ## Contents
6
+
7
+ - `example/`: Sample map directory demonstrating map and legend file organization
8
+
9
+ ## Map File Format
10
+
11
+ Maps use ASCII text files where each character represents a different type of terrain, object, or game element. The visual representation uses various ASCII characters to create recognizable layouts.
12
+
13
+ ### Common Map Characters
14
+
15
+ - **Box-drawing characters**: For walls and structures (`╭`, `╮`, `╯`, `╰`, `│`, `─`, `├`, `┤`, `┬`, `┴`)
16
+ - **Partial walls**: For incomplete barriers (`╷`, `╵`, `╶`, `╴`)
17
+ - **Special characters**: For doors (`o`), spawn points, or interactive elements
18
+ - **Spaces**: For walkable floor areas
19
+ - **Custom characters**: Any ASCII character can be assigned meaning through legends
20
+
21
+ ## Legend Files
22
+
23
+ Each map should have an accompanying `legend.json` file that defines what each character represents. This allows the game engine to understand collision, rendering, and gameplay properties.
24
+
25
+ ### Legend Structure
26
+
27
+ Legends use an array format where each entry groups characters with shared properties:
28
+
29
+ ```json
30
+ {
31
+ "legend": [
32
+ {
33
+ "chars": ["╭", "╮", "╯", "╰", "│", "─"],
34
+ "kind": "material",
35
+ "name": "wall",
36
+ "solid": true,
37
+ "asset": "material/brick-wall"
38
+ },
39
+ {
40
+ "chars": ["o"],
41
+ "kind": "material",
42
+ "name": "door",
43
+ "solid": false,
44
+ "entity": "door",
45
+ "asset": "material/wood-door-on-brick-wall"
46
+ }
47
+ ]
48
+ }
49
+ ```
50
+
51
+ ### Legend Properties
52
+
53
+ #### Required Properties
54
+
55
+ - **chars**: Array of characters that share the same properties (e.g., all wall variations)
56
+ - **kind**: Type of asset (`"material"` for terrain/environment, `"sprite"` for animated entities)
57
+ - **solid**: Whether the object blocks player movement (`true`/`false`)
58
+ - **asset**: Reference to visual asset file in the materials or sprites directories
59
+
60
+ #### Optional Properties
61
+
62
+ - **name**: Human-readable description for the object type
63
+ - **visible**: Whether the object appears in map view (`true`/`false`). Defaults to `true`. When `false`, renders as a space in MapView but still appears in first-person view. Useful for ground items, invisible triggers, or objects that should only be visible up close.
64
+ - **entity**: Gameplay entity type that defines behavior (e.g., `"door"`, `"enemy"`, `"treasure"`, `"trap"`, `"item"`)
65
+ - **variant**: Specific subtype of the entity (e.g., `"wooden"`, `"iron"`, `"magic"`, `"bone"`)
66
+
67
+ **Note:** The `chars` array allows you to group multiple map characters that share identical properties, significantly reducing legend file size and making them easier to maintain.
68
+
69
+ ### Entity and Variant System
70
+
71
+ The `entity` and `variant` properties work together to define gameplay behavior:
72
+
73
+ - **entity**: The primary type that determines how the game handles interactions (door, enemy, treasure, trap, item, etc.)
74
+ - **variant**: The specific implementation or subtype (wooden-door, iron-door, wolf, bone, spike-trap, etc.)
75
+
76
+ This separation allows for:
77
+ - Shared behavior across similar entities (all doors can be opened/closed)
78
+ - Variant-specific properties (wooden doors are weak, iron doors are strong)
79
+ - Clear gameplay categorization
80
+
81
+ ### Common Entity Types
82
+
83
+ Here are standard entity types used in dungeon crawlers:
84
+
85
+ #### **door**
86
+ Openable/closable passages, may be locked
87
+ ```json
88
+ {
89
+ "chars": ["o"],
90
+ "entity": "door",
91
+ "variant": "wooden",
92
+ "solid": false
93
+ }
94
+ ```
95
+
96
+ #### **enemy**
97
+ Hostile creatures or NPCs
98
+ ```json
99
+ {
100
+ "chars": ["w"],
101
+ "entity": "enemy",
102
+ "variant": "wolf",
103
+ "solid": true
104
+ }
105
+ ```
106
+
107
+ #### **treasure**
108
+ Collectible currency or valuables
109
+ ```json
110
+ {
111
+ "chars": ["g"],
112
+ "entity": "treasure",
113
+ "variant": "gold-pile",
114
+ "solid": false
115
+ }
116
+ ```
117
+
118
+ #### **item**
119
+ Pickup-able objects for inventory
120
+ ```json
121
+ {
122
+ "chars": ["b"],
123
+ "entity": "item",
124
+ "variant": "bone",
125
+ "solid": false,
126
+ "visible": false
127
+ }
128
+ ```
129
+ **Note:** Items often use `"visible": false` so they appear in first-person view but not on the map, creating a more immersive exploration experience.
130
+
131
+ #### **trap**
132
+ Hazards that trigger on player interaction
133
+ ```json
134
+ {
135
+ "chars": ["^"],
136
+ "entity": "trap",
137
+ "variant": "spike",
138
+ "solid": false
139
+ }
140
+ ```
141
+
142
+ #### **mechanism**
143
+ Switches, levers, pressure plates
144
+ ```json
145
+ {
146
+ "chars": ["L"],
147
+ "entity": "mechanism",
148
+ "variant": "lever",
149
+ "solid": true
150
+ }
151
+ ```
152
+
153
+ #### **destructible**
154
+ Breakable objects like crates or barrels
155
+ ```json
156
+ {
157
+ "chars": ["C"],
158
+ "entity": "destructible",
159
+ "variant": "crate",
160
+ "solid": true
161
+ }
162
+ ```
163
+
164
+ #### **npc**
165
+ Non-hostile characters for dialog/quests
166
+ ```json
167
+ {
168
+ "chars": ["@"],
169
+ "entity": "npc",
170
+ "variant": "merchant",
171
+ "solid": true
172
+ }
173
+ ```
174
+
175
+ ## Directory Organization
176
+
177
+ Each map should be organized in its own subdirectory containing:
178
+
179
+ - `map.art`: The ASCII map layout file
180
+ - `legend.json`: Character-to-object mapping definitions
181
+ - Optional: Additional map variants or related files
182
+
183
+ Example structure:
184
+
185
+ ```text
186
+ maps/
187
+ ├─ underground/
188
+ │ ├─ map.art
189
+ │ └─ legend.json
190
+ ├─ overworld/
191
+ │ ├─ map.art
192
+ │ └─ legend.json
193
+ └─ example/
194
+ ├─ map.art
195
+ └─ legend.json
196
+ ```
197
+
198
+ ## Usage in Asciitorium
199
+
200
+ Maps are loaded by the `MapView` component using the `src` property:
201
+
202
+ ```tsx
203
+ <MapView
204
+ src="./art/maps/example/map.art"
205
+ player={playerPosition}
206
+ fogOfWar={false}
207
+ />
208
+ ```
209
+
210
+ The component automatically looks for the corresponding `legend.json` file in the same directory to understand how to interpret the map characters.
211
+
212
+ ## Creating New Maps
213
+
214
+ ### Manual Creation
215
+
216
+ When creating new maps manually:
217
+
218
+ 1. Design your layout using ASCII characters in a text file
219
+ 2. Create a `legend.json` file defining what each character represents
220
+ 3. Organize both files in a dedicated subdirectory
221
+ 4. Reference appropriate assets in the materials and sprites directories
222
+ 5. Test with the `MapView` component to ensure proper rendering and collision
223
+
224
+ ### Automated Generation
225
+
226
+ For quick map generation, use the included `map-builder.js` script:
227
+
228
+ ```bash
229
+ node scripts/map-builder.js <width> <height> <directory-name> [--smooth]
230
+ ```
231
+
232
+ **Examples:**
233
+
234
+ ```bash
235
+ # Generate a basic 20x15 map in 'my-dungeon' directory
236
+ node scripts/map-builder.js 20 15 my-dungeon
237
+
238
+ # Generate a map with smooth Unicode box-drawing characters
239
+ node scripts/map-builder.js 30 20 castle-level --smooth
240
+ ```
241
+
242
+ **Options:**
243
+
244
+ - `width`: Map width in characters
245
+ - `height`: Map height in characters
246
+ - `directory-name`: Name of the directory to create (saved to `public/art/maps/<directory-name>/map.art`)
247
+ - `--smooth`: Use Unicode box-drawing characters for smoother appearance
248
+
249
+ The script automatically generates a maze-like layout with corridors and rooms, creating both a `map.art` file and the proper directory structure. This provides a perfect starting point for dungeon-style maps that you can then customize manually.
250
+
251
+ Use the `example/` directory as a reference for proper file organization and legend format.
@@ -0,0 +1,62 @@
1
+ # Example Map Directory
2
+
3
+ This folder demonstrates how to create a basic game level map for asciitorium.
4
+
5
+ ## Contents
6
+
7
+ - `example.art`: The ASCII map layout showing a dungeon with rooms and corridors
8
+ - `legend.json`: Maps characters in the map to materials and sprites
9
+
10
+ ## Map Example
11
+
12
+ Here's a portion of the example map (`example.art`):
13
+
14
+ ```text
15
+ ╭───────────────────────────────────┬───╮
16
+ │ │ │
17
+ │ ╷ ╭───────────────┬───────╮ ╰─o─┤
18
+ │ │ │ │ │ │
19
+ │ │ ╵ ╶───────╮ ├─o─╮ ╰───╮ │
20
+ │ │ │ │ │ │ │
21
+ │ ╰───────┬───────╯ ├───┤ ╭───╯ │
22
+ │ │ │ │ │ │
23
+ ├───────────╯ ╭───────┴─o─┤ │ ╶───┤
24
+ ```
25
+
26
+ This represents a game layout with:
27
+
28
+ - **Walls**: Various box-drawing characters (`╭`, `╮`, `╯`, `╰`, `│`, `─`, `├`, `┤`, `┬`, `┴`)
29
+ - **Doors**: `o` characters at strategic connection points
30
+ - **Open spaces**: Regular spaces for walkable areas
31
+ - **Partial walls**: `╷`, `╵`, `╶`, `╴` for incomplete barriers
32
+
33
+ ## Legend Format
34
+
35
+ The `legend.json` file defines what each character represents:
36
+
37
+ ```json
38
+ {
39
+ "╭": { "kind": "material", "name": "wall", "solid": true, "asset": "wall" },
40
+ "╮": { "kind": "material", "name": "wall", "solid": true, "asset": "wall" },
41
+ "│": { "kind": "material", "name": "wall", "solid": true, "asset": "wall" },
42
+ "─": { "kind": "material", "name": "wall", "solid": true, "asset": "wall" },
43
+ "o": {
44
+ "kind": "material",
45
+ "name": "door",
46
+ "solid": true,
47
+ "tag": "door",
48
+ "asset": "door"
49
+ },
50
+ " ": { "kind": "material", "name": "floor", "solid": false, "asset": "floor" }
51
+ }
52
+ ```
53
+
54
+ ### Legend Properties
55
+
56
+ - **kind**: Type of object (`"material"` for terrain, `"sprite"` for entities)
57
+ - **name**: Descriptive name for the object
58
+ - **solid**: Whether the object blocks movement (`true`/`false`)
59
+ - **tag**: Optional category for gameplay logic (e.g., `"door"`, `"enemy"`)
60
+ - **asset**: Reference to the visual asset file to use for rendering (all asset files assumed to end in .art)
61
+
62
+ Use this example as a reference for organizing your own maps, materials, and sprites in asciitorium.
@@ -0,0 +1,29 @@
1
+ {
2
+ "legend": [
3
+ {
4
+ "chars": ["╭", "╮", "╯", "╰", "│", "─", "├", "┤", "┬", "┴", "╷", "╵", "╶", "╴"],
5
+ "kind": "material",
6
+ "name": "wall",
7
+ "solid": true,
8
+ "asset": "material/wall-brick"
9
+ },
10
+ {
11
+ "chars": ["o"],
12
+ "kind": "material",
13
+ "name": "door",
14
+ "solid": false,
15
+ "entity": "door",
16
+ "asset": "material/door-wooden"
17
+ },
18
+ {
19
+ "chars": ["b"],
20
+ "kind": "material",
21
+ "name": "bone",
22
+ "solid": false,
23
+ "visible": false,
24
+ "entity": "item",
25
+ "variant": "bone",
26
+ "asset": "material/bone"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,21 @@
1
+ ╭───────────────────────────────────┬───╮
2
+ │ │ │
3
+ │ ╷ ╭───────────────┬───────╮ ╰─o─┤
4
+ │ │ │ │ │ │
5
+ │ │ ╵ ╶───────╮ ├─o─╮ ╰───╮ │
6
+ │ │ │ │ │ │ │
7
+ │ ╰───────┬───────╯ ├───┤ ╭───╯ │
8
+ │ b │ │ │ │ │
9
+ ├───────────╯ ┴─o─┤ │ ╶───┤
10
+ │ │ │ │
11
+ │ ╭───────┬ ╭───────╯ ├───╮ │
12
+ │ │ │ │ │ │
13
+ │ ╰───┬─o─┤ ╭───┤───────╮ ├─o─┤ │
14
+ │ │ │ │ │ │ │ │ │
15
+ ├───╮ ╰───╯ ├─o─╯ ╷ │ ╵ │ │
16
+ │ │ │ │ │ │ │
17
+ ├─o─┴───────────┤ ╭───╯ ├───────┤ │
18
+ │ │ │ │ │ │
19
+ │ ╶───╮ ╶───╯ │ ╶───╯ ╷ ╵ │
20
+ │ │ │ │ │
21
+ ╰───────┴───────────┴───────────┴───────╯