@jfvilas/kwirth-plugin-rallyx 0.1.2 → 0.1.3
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 +76 -76
- package/front.js +3554 -3563
- package/package.json +1 -1
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,76 @@
|
|
|
1
|
-
# Rally-X
|
|
2
|
-
|
|
3
|
-
A Rally-X arcade game channel plugin for [Kwirth](https://kwirthmagnify.dev), the Kubernetes
|
|
4
|
-
observability and operations platform ([source](https://github.com/kwirthmagnify/kwirth)).
|
|
5
|
-
|
|
6
|
-
## What it is
|
|
7
|
-
|
|
8
|
-
This plugin runs a homebrew recreation of the classic 1980s Rally-X arcade game
|
|
9
|
-
(originally by Midway/Namco) inside a Kwirth tab. The game is built with Phaser
|
|
10
|
-
2.x and runs in an isolated iframe, so its globals never clash with Kwirth's
|
|
11
|
-
React/MUI.
|
|
12
|
-
|
|
13
|
-
The game state (score, lives, round, fuel) is displayed in a HUD bar above the
|
|
14
|
-
game area. High scores are persisted in a Kubernetes ConfigMap, shared across
|
|
15
|
-
all users of the cluster.
|
|
16
|
-
|
|
17
|
-
## How it works
|
|
18
|
-
|
|
19
|
-
- The game (Phaser + RequireJS + all assets) is bundled into the plugin's
|
|
20
|
-
`front.js` as text and base64. At runtime, it is injected into an iframe via
|
|
21
|
-
`srcdoc` — no network requests needed.
|
|
22
|
-
- The iframe survives tab switches: switching away hides it, switching back
|
|
23
|
-
repositions it. Only stopping the channel destroys it.
|
|
24
|
-
- A `postMessage` bridge reports game state to the plugin for HUD display and
|
|
25
|
-
score persistence.
|
|
26
|
-
- High scores are stored via the back channel's `writeStorage` (ConfigMap
|
|
27
|
-
`kwirth-store-channel-rallyx-scores`).
|
|
28
|
-
|
|
29
|
-
## Installation
|
|
30
|
-
|
|
31
|
-
Rally-X is published to npm as `@jfvilas/kwirth-plugin-rallyx` and listed in the **jfvilas marketplace**.
|
|
32
|
-
If your Kwirth does not list it yet, add this manifest as a marketplace:
|
|
33
|
-
|
|
34
|
-
```
|
|
35
|
-
https://raw.githubusercontent.com/jfvilas/kwirth/master/manifest.json
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
Then install **Rally-X** from the plugin manager and add the channel to a tab. Source code at
|
|
39
|
-
[github.com/jfvilas/kwirth](https://github.com/jfvilas/kwirth) (folder `plugins/rallyx`).
|
|
40
|
-
|
|
41
|
-
## Controls
|
|
42
|
-
|
|
43
|
-
| Key | Action |
|
|
44
|
-
|-----|--------|
|
|
45
|
-
| ← ↑ → ↓ | Drive |
|
|
46
|
-
| Ctrl | Drop smoke |
|
|
47
|
-
| Space / Ctrl | Start (on title screen) |
|
|
48
|
-
|
|
49
|
-
## Architecture
|
|
50
|
-
|
|
51
|
-
```
|
|
52
|
-
src/
|
|
53
|
-
├── back/index.ts — back channel: score persistence (ConfigMap)
|
|
54
|
-
├── common/RallyxTypes.ts — shared types
|
|
55
|
-
├── front/
|
|
56
|
-
│ ├── index.ts — registers RallyxChannel on window.__kwirth_plugins__
|
|
57
|
-
│ ├── RallyxChannel.tsx — IChannel impl (lifecycle, message routing)
|
|
58
|
-
│ ├── RallyxMachine.ts — iframe manager (builds HTML, manages lifecycle)
|
|
59
|
-
│ ├── RallyxTabContent.tsx — tab UI (HUD, game area, scores overlay)
|
|
60
|
-
│ ├── RallyxSetup.tsx — setup dialog (sender notification, pause-on-blur)
|
|
61
|
-
│ ├── RallyxConfig.ts — config classes
|
|
62
|
-
│ ├── RallyxData.ts — channel state (survives tab switches)
|
|
63
|
-
│ ├── RallyxScores.ts — score store (back + local fallback)
|
|
64
|
-
│ ├── icons.tsx — plugin icon
|
|
65
|
-
│ └── rallyx/
|
|
66
|
-
│ ├── phaser.txt — Phaser 2.x library
|
|
67
|
-
│ ├── require.txt — RequireJS library
|
|
68
|
-
│ ├── js/*.txt — game modules (named AMD defines)
|
|
69
|
-
│ └── assets/ — game assets (PNGs, tilemap JSON)
|
|
70
|
-
└── types/assets.d.ts — ambient declarations for non-TS imports
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
## License
|
|
74
|
-
|
|
75
|
-
The upstream game is MIT licensed (Copyright (c) 2017 Marco Parenzan).
|
|
76
|
-
See [NOTICE.md](NOTICE.md) for full attribution.
|
|
1
|
+
# Rally-X
|
|
2
|
+
|
|
3
|
+
A Rally-X arcade game channel plugin for [Kwirth](https://kwirthmagnify.dev), the Kubernetes
|
|
4
|
+
observability and operations platform ([source](https://github.com/kwirthmagnify/kwirth)).
|
|
5
|
+
|
|
6
|
+
## What it is
|
|
7
|
+
|
|
8
|
+
This plugin runs a homebrew recreation of the classic 1980s Rally-X arcade game
|
|
9
|
+
(originally by Midway/Namco) inside a Kwirth tab. The game is built with Phaser
|
|
10
|
+
2.x and runs in an isolated iframe, so its globals never clash with Kwirth's
|
|
11
|
+
React/MUI.
|
|
12
|
+
|
|
13
|
+
The game state (score, lives, round, fuel) is displayed in a HUD bar above the
|
|
14
|
+
game area. High scores are persisted in a Kubernetes ConfigMap, shared across
|
|
15
|
+
all users of the cluster.
|
|
16
|
+
|
|
17
|
+
## How it works
|
|
18
|
+
|
|
19
|
+
- The game (Phaser + RequireJS + all assets) is bundled into the plugin's
|
|
20
|
+
`front.js` as text and base64. At runtime, it is injected into an iframe via
|
|
21
|
+
`srcdoc` — no network requests needed.
|
|
22
|
+
- The iframe survives tab switches: switching away hides it, switching back
|
|
23
|
+
repositions it. Only stopping the channel destroys it.
|
|
24
|
+
- A `postMessage` bridge reports game state to the plugin for HUD display and
|
|
25
|
+
score persistence.
|
|
26
|
+
- High scores are stored via the back channel's `writeStorage` (ConfigMap
|
|
27
|
+
`kwirth-store-channel-rallyx-scores`).
|
|
28
|
+
|
|
29
|
+
## Installation
|
|
30
|
+
|
|
31
|
+
Rally-X is published to npm as `@jfvilas/kwirth-plugin-rallyx` and listed in the **jfvilas marketplace**.
|
|
32
|
+
If your Kwirth does not list it yet, add this manifest as a marketplace:
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
https://raw.githubusercontent.com/jfvilas/kwirth/master/manifest.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Then install **Rally-X** from the plugin manager and add the channel to a tab. Source code at
|
|
39
|
+
[github.com/jfvilas/kwirth](https://github.com/jfvilas/kwirth) (folder `plugins/rallyx`).
|
|
40
|
+
|
|
41
|
+
## Controls
|
|
42
|
+
|
|
43
|
+
| Key | Action |
|
|
44
|
+
|-----|--------|
|
|
45
|
+
| ← ↑ → ↓ | Drive |
|
|
46
|
+
| Ctrl | Drop smoke |
|
|
47
|
+
| Space / Ctrl | Start (on title screen) |
|
|
48
|
+
|
|
49
|
+
## Architecture
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
src/
|
|
53
|
+
├── back/index.ts — back channel: score persistence (ConfigMap)
|
|
54
|
+
├── common/RallyxTypes.ts — shared types
|
|
55
|
+
├── front/
|
|
56
|
+
│ ├── index.ts — registers RallyxChannel on window.__kwirth_plugins__
|
|
57
|
+
│ ├── RallyxChannel.tsx — IChannel impl (lifecycle, message routing)
|
|
58
|
+
│ ├── RallyxMachine.ts — iframe manager (builds HTML, manages lifecycle)
|
|
59
|
+
│ ├── RallyxTabContent.tsx — tab UI (HUD, game area, scores overlay)
|
|
60
|
+
│ ├── RallyxSetup.tsx — setup dialog (sender notification, pause-on-blur)
|
|
61
|
+
│ ├── RallyxConfig.ts — config classes
|
|
62
|
+
│ ├── RallyxData.ts — channel state (survives tab switches)
|
|
63
|
+
│ ├── RallyxScores.ts — score store (back + local fallback)
|
|
64
|
+
│ ├── icons.tsx — plugin icon
|
|
65
|
+
│ └── rallyx/
|
|
66
|
+
│ ├── phaser.txt — Phaser 2.x library
|
|
67
|
+
│ ├── require.txt — RequireJS library
|
|
68
|
+
│ ├── js/*.txt — game modules (named AMD defines)
|
|
69
|
+
│ └── assets/ — game assets (PNGs, tilemap JSON)
|
|
70
|
+
└── types/assets.d.ts — ambient declarations for non-TS imports
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## License
|
|
74
|
+
|
|
75
|
+
The upstream game is MIT licensed (Copyright (c) 2017 Marco Parenzan).
|
|
76
|
+
See [NOTICE.md](NOTICE.md) for full attribution.
|