@jfvilas/kwirth-plugin-rallyx 0.1.2 → 0.1.4
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/NOTICE.md +74 -74
- package/README.md +96 -76
- package/front.js +3556 -3565
- package/package.json +6 -2
package/NOTICE.md
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
# NOTICE — Rally-X Plugin
|
|
2
|
-
|
|
3
|
-
## Upstream Game
|
|
4
|
-
|
|
5
|
-
The Rally-X game is a homebrew recreation of the classic 1980s arcade game
|
|
6
|
-
Rally-X (originally by Midway/Namco), developed by Marco Parenzan.
|
|
7
|
-
|
|
8
|
-
- **Source:** https://github.com/marcoparenzan/rallyx
|
|
9
|
-
- **License:** MIT (see below)
|
|
10
|
-
- **Technology:** Phaser 2.x (HTML5 game framework) + RequireJS (AMD module loader)
|
|
11
|
-
|
|
12
|
-
### Modifications
|
|
13
|
-
|
|
14
|
-
The game code has been adapted to run inside a Kwirth plugin iframe:
|
|
15
|
-
|
|
16
|
-
1. **Named AMD defines:** The original modules use anonymous `define([])` calls
|
|
17
|
-
that rely on the script URL for the module name. In the iframe (inline
|
|
18
|
-
scripts), there is no URL, so each module has been given an explicit name:
|
|
19
|
-
`define("car", [])`, `define("flag", [])`, etc.
|
|
20
|
-
|
|
21
|
-
2. **Cookie → localStorage:** The original high-score persistence uses browser
|
|
22
|
-
cookies. In the iframe `srcdoc` context, cookies are unreliable, so the
|
|
23
|
-
`setCookie`/`getCookie`/`deleteCookie` functions have been replaced with
|
|
24
|
-
`localStorage` equivalents.
|
|
25
|
-
|
|
26
|
-
3. **postMessage bridge:** A bridge has been added to report game state (score,
|
|
27
|
-
lives, round, fuel) and game-over events to the parent window (the Kwirth
|
|
28
|
-
plugin), so the plugin can display HUD values and persist scores in the
|
|
29
|
-
cluster's ConfigMap.
|
|
30
|
-
|
|
31
|
-
4. **Asset loading:** Assets are inlined as data URIs. A Phaser loader patch
|
|
32
|
-
redirects the game's `"assets/..."` URLs to these data URIs, so the game
|
|
33
|
-
code itself is unmodified in its asset loading calls.
|
|
34
|
-
|
|
35
|
-
### Files vendored from upstream
|
|
36
|
-
|
|
37
|
-
- `src/front/rallyx/phaser.txt` — Phaser 2.x library (unmodified)
|
|
38
|
-
- `src/front/rallyx/require.txt` — RequireJS library (unmodified)
|
|
39
|
-
- `src/front/rallyx/js/*.txt` — Game modules (modified as described above)
|
|
40
|
-
- `src/front/rallyx/assets/*` — Game assets (unmodified)
|
|
41
|
-
|
|
42
|
-
## Phaser
|
|
43
|
-
|
|
44
|
-
- **Source:** https://phaser.io/
|
|
45
|
-
- **License:** MIT
|
|
46
|
-
|
|
47
|
-
## RequireJS
|
|
48
|
-
|
|
49
|
-
- **Source:** https://requirejs.org/
|
|
50
|
-
- **License:** MIT
|
|
51
|
-
|
|
52
|
-
## License (upstream game)
|
|
53
|
-
|
|
54
|
-
The MIT License (MIT)
|
|
55
|
-
|
|
56
|
-
Copyright (c) 2017 Marco Parenzan
|
|
57
|
-
|
|
58
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
59
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
60
|
-
in the Software without restriction, including without limitation the rights
|
|
61
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
62
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
63
|
-
furnished to do so, subject to the following conditions:
|
|
64
|
-
|
|
65
|
-
The above copyright notice and this permission notice shall be included in
|
|
66
|
-
all copies or substantial portions of the Software.
|
|
67
|
-
|
|
68
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
69
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
70
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
71
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
72
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
73
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
74
|
-
THE SOFTWARE.
|
|
1
|
+
# NOTICE — Rally-X Plugin
|
|
2
|
+
|
|
3
|
+
## Upstream Game
|
|
4
|
+
|
|
5
|
+
The Rally-X game is a homebrew recreation of the classic 1980s arcade game
|
|
6
|
+
Rally-X (originally by Midway/Namco), developed by Marco Parenzan.
|
|
7
|
+
|
|
8
|
+
- **Source:** https://github.com/marcoparenzan/rallyx
|
|
9
|
+
- **License:** MIT (see below)
|
|
10
|
+
- **Technology:** Phaser 2.x (HTML5 game framework) + RequireJS (AMD module loader)
|
|
11
|
+
|
|
12
|
+
### Modifications
|
|
13
|
+
|
|
14
|
+
The game code has been adapted to run inside a Kwirth plugin iframe:
|
|
15
|
+
|
|
16
|
+
1. **Named AMD defines:** The original modules use anonymous `define([])` calls
|
|
17
|
+
that rely on the script URL for the module name. In the iframe (inline
|
|
18
|
+
scripts), there is no URL, so each module has been given an explicit name:
|
|
19
|
+
`define("car", [])`, `define("flag", [])`, etc.
|
|
20
|
+
|
|
21
|
+
2. **Cookie → localStorage:** The original high-score persistence uses browser
|
|
22
|
+
cookies. In the iframe `srcdoc` context, cookies are unreliable, so the
|
|
23
|
+
`setCookie`/`getCookie`/`deleteCookie` functions have been replaced with
|
|
24
|
+
`localStorage` equivalents.
|
|
25
|
+
|
|
26
|
+
3. **postMessage bridge:** A bridge has been added to report game state (score,
|
|
27
|
+
lives, round, fuel) and game-over events to the parent window (the Kwirth
|
|
28
|
+
plugin), so the plugin can display HUD values and persist scores in the
|
|
29
|
+
cluster's ConfigMap.
|
|
30
|
+
|
|
31
|
+
4. **Asset loading:** Assets are inlined as data URIs. A Phaser loader patch
|
|
32
|
+
redirects the game's `"assets/..."` URLs to these data URIs, so the game
|
|
33
|
+
code itself is unmodified in its asset loading calls.
|
|
34
|
+
|
|
35
|
+
### Files vendored from upstream
|
|
36
|
+
|
|
37
|
+
- `src/front/rallyx/phaser.txt` — Phaser 2.x library (unmodified)
|
|
38
|
+
- `src/front/rallyx/require.txt` — RequireJS library (unmodified)
|
|
39
|
+
- `src/front/rallyx/js/*.txt` — Game modules (modified as described above)
|
|
40
|
+
- `src/front/rallyx/assets/*` — Game assets (unmodified)
|
|
41
|
+
|
|
42
|
+
## Phaser
|
|
43
|
+
|
|
44
|
+
- **Source:** https://phaser.io/
|
|
45
|
+
- **License:** MIT
|
|
46
|
+
|
|
47
|
+
## RequireJS
|
|
48
|
+
|
|
49
|
+
- **Source:** https://requirejs.org/
|
|
50
|
+
- **License:** MIT
|
|
51
|
+
|
|
52
|
+
## License (upstream game)
|
|
53
|
+
|
|
54
|
+
The MIT License (MIT)
|
|
55
|
+
|
|
56
|
+
Copyright (c) 2017 Marco Parenzan
|
|
57
|
+
|
|
58
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
59
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
60
|
+
in the Software without restriction, including without limitation the rights
|
|
61
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
62
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
63
|
+
furnished to do so, subject to the following conditions:
|
|
64
|
+
|
|
65
|
+
The above copyright notice and this permission notice shall be included in
|
|
66
|
+
all copies or substantial portions of the Software.
|
|
67
|
+
|
|
68
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
69
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
70
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
71
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
72
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
73
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
74
|
+
THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,76 +1,96 @@
|
|
|
1
|
-
# Rally-X
|
|
2
|
-
|
|
3
|
-
A Rally-X arcade game
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
##
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
1
|
+
# Rally-X — a channel plugin for Kwirth
|
|
2
|
+
|
|
3
|
+
A Rally-X arcade game inside a [Kwirth](https://kwirthmagnify.dev) tab: drive your blue car through the maze,
|
|
4
|
+
pick up the flags before the fuel runs out, and lose the red cars behind a cloud of smoke. A homebrew
|
|
5
|
+
recreation of the 1980 arcade classic, with a high-score table shared by everyone on the cluster.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
- Kwirth: https://kwirthmagnify.dev — source at https://github.com/kwirthmagnify/kwirth
|
|
10
|
+
- Plugin source: https://github.com/jfvilas/kwirth (folder `plugins/rallyx`)
|
|
11
|
+
- The game is MIT licensed, Copyright (c) 2017 Marco Parenzan; see [NOTICE.md](NOTICE.md).
|
|
12
|
+
|
|
13
|
+
## What it is
|
|
14
|
+
|
|
15
|
+
A **standalone channel**: it reads nothing of the cluster, asks for no cluster scope and selects no pods.
|
|
16
|
+
Picking it switches the view to `none` on its own.
|
|
17
|
+
|
|
18
|
+
The game is built with Phaser 2 and runs in an isolated iframe, so its globals never clash with Kwirth's.
|
|
19
|
+
Phaser, RequireJS and every asset travel inside the plugin's `front.js`, so it needs no network once
|
|
20
|
+
installed. The iframe **survives tab switches**: switching away hides it, coming back puts it in place again,
|
|
21
|
+
and only stopping the channel destroys it. A small bridge reports the game's state to the tab, which shows
|
|
22
|
+
it in the bar above the game: score, lives, round, fuel and best score.
|
|
23
|
+
|
|
24
|
+
## Using it
|
|
25
|
+
|
|
26
|
+
Add the **rallyx** channel to a tab and start it. The setup asks for:
|
|
27
|
+
|
|
28
|
+
| Field | Meaning |
|
|
29
|
+
|---|---|
|
|
30
|
+
| **Notify a sender when the record is beaten** | Optional: one of Kwirth's senders gets a message when someone takes the top of the table |
|
|
31
|
+
| **Pause when the tab loses focus** | The game freezes when you click elsewhere, and goes on when you click it again |
|
|
32
|
+
|
|
33
|
+
| Key | Action |
|
|
34
|
+
|---|---|
|
|
35
|
+
| Arrows | Drive |
|
|
36
|
+
| Ctrl | Smoke screen |
|
|
37
|
+
| Space / Ctrl | Start, on the title screen |
|
|
38
|
+
| Ctrl+Shift+Enter | Kwirth's full screen, also while the game has the focus |
|
|
39
|
+
|
|
40
|
+
The game keeps its 4:3 proportions and fits the tab.
|
|
41
|
+
|
|
42
|
+
## The high-score table
|
|
43
|
+
|
|
44
|
+
It lives in the cluster, not in the browser: the back end stores it in a ConfigMap,
|
|
45
|
+
`kwirth-store-channel-rallyx-scores`, so every user of that Kwirth sees the same table and it survives
|
|
46
|
+
changing machines.
|
|
47
|
+
|
|
48
|
+
## Installing it in Kwirth
|
|
49
|
+
|
|
50
|
+
It is published on npmjs as `@jfvilas/kwirth-plugin-rallyx` and listed in the jfvilas marketplace. If your
|
|
51
|
+
Kwirth does not list it yet, add it as a marketplace with this manifest URL:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
https://raw.githubusercontent.com/jfvilas/kwirth/master/manifest.json
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Then install `rallyx` from the plugin manager. No restart is needed and it depends on no other extension.
|
|
58
|
+
|
|
59
|
+
## Screenshots
|
|
60
|
+
|
|
61
|
+
The setup:
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
The title screen:
|
|
66
|
+
|
|
67
|
+

|
|
68
|
+
|
|
69
|
+
Full screen:
|
|
70
|
+
|
|
71
|
+

|
|
72
|
+
|
|
73
|
+
## Building
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
npm install
|
|
77
|
+
npm run build # typecheck + dist/
|
|
78
|
+
npm run watch # fast rebuild without typecheck
|
|
79
|
+
npm test # unit tests
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The e2e (`e2e/`, Playwright) runs against a live Kwirth with its own `.creds.json`;
|
|
83
|
+
`tests/zz-readme.spec.ts` takes the screenshots of this README.
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
src/
|
|
87
|
+
├── back/index.ts back channel: the score table (ConfigMap)
|
|
88
|
+
├── common/RallyxTypes.ts shared types
|
|
89
|
+
└── front/
|
|
90
|
+
├── RallyxChannel.tsx the channel: lifecycle and messages
|
|
91
|
+
├── RallyxMachine.ts the iframe: builds its HTML, keeps it alive
|
|
92
|
+
├── RallyxTabContent.tsx the tab: HUD, game area, score panel
|
|
93
|
+
├── RallyxSetup.tsx the setup dialog
|
|
94
|
+
├── RallyxScores.ts the score store (back, with a local fallback)
|
|
95
|
+
└── rallyx/ Phaser, RequireJS, the game modules and its assets
|
|
96
|
+
```
|