reight 0.1.18 → 0.2.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1751996f1a274e567963f26fcd4b1130d2f23b33380f1757ee7caf4e26f36b36
4
- data.tar.gz: 464e9a90cc0021ccc0437191d6ad0455f4ae7f0b4ccc325671546003d25631f0
3
+ metadata.gz: d3674b778fe6d2453add5a4a9ba1cdea93f9d8a3a27d584d929894b6fc63b561
4
+ data.tar.gz: c322aea76c3ff5b319990d4ec14fd3b864d6573082ebd5c42334608fc70c4fe8
5
5
  SHA512:
6
- metadata.gz: ac07bacf3ca5e59c3537976bc305f4b1434e53cccee9abc34c2d3d10e0f1de7c13a45a61ba8951d85964eec80bd90ec17f83c2d56e204b162f9d40be811f9ab0
7
- data.tar.gz: b5f5bbba9ca3e19fd847c7f8510049e48af988bb3492c747b7b45ffbea46657d65d227c8a6fb146ae601027a6bc77be7bab8dda6b48ef4478bd5b870733ff475
6
+ metadata.gz: 9f5b6c8abff843e9b3b7bd0478ee9bcf8da602cae8195a12b770bd94820a05df0d87569df2524f3d740301c0dbe132be25a04c4f4b762c959667ac04966708ef
7
+ data.tar.gz: d9487e23499975c8e890cc8b6c6055fadb01365f86f0c65f5680dad7d1188a3ade44436aa6899c7826943893fdf69c0bdee2416b89883273953978cadd3170bb
@@ -36,23 +36,9 @@ jobs:
36
36
  echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
37
37
 
38
38
  - name: create github release
39
- id: release
40
- uses: actions/create-release@v1
41
39
  env:
42
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43
- with:
44
- tag_name: ${{ github.ref }}
45
- release_name: ${{ github.ref }}
46
-
47
- - name: upload to github release
48
- uses: actions/upload-release-asset@v1
49
- env:
50
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51
- with:
52
- upload_url: ${{ steps.release.outputs.upload_url }}
53
- asset_path: ./${{ steps.gem.outputs.path }}
54
- asset_name: ${{ steps.gem.outputs.path }}
55
- asset_content_type: application/zip
40
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
+ run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
56
42
 
57
43
  - name: upload to rubygems
58
44
  env:
data/ChangeLog.md CHANGED
@@ -1,6 +1,14 @@
1
1
  # reight ChangeLog
2
2
 
3
3
 
4
+ ## [v0.2.0] - 2026-05-17
5
+
6
+ - [BREAKING] Wheel Y delta now follows top-left origin convention (from reflex)
7
+
8
+ - Rewrite README.md
9
+ - CI: Migrate release-gem.yml from actions/create-release to gh release create
10
+
11
+
4
12
  ## [v0.1.18] - 2026-05-10
5
13
 
6
14
  - Support WebAssembly
data/README.md CHANGED
@@ -1,68 +1,185 @@
1
- # Reight - A Retro Game Engine for Ruby
1
+ # Reight - A retro game engine for Ruby
2
2
 
3
3
  [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/xord/reight)
4
4
  ![License](https://img.shields.io/github/license/xord/reight)
5
5
  ![Build Status](https://github.com/xord/reight/actions/workflows/test.yml/badge.svg)
6
6
  ![Gem Version](https://badge.fury.io/rb/reight.svg)
7
7
 
8
- Reight is an open-source Ruby library inspired by the powerful [Processing](https://processing.org/) API, designed to make creative coding accessible and enjoyable for everyone. With support for both Mac and Windows, this library brings the joy of visual programming to Ruby developers.
8
+ ## ⚠️ Notice
9
9
 
10
- ## Features
10
+ This repository is a read-only mirror of our monorepo.
11
+ We do not accept pull requests or direct contributions here.
11
12
 
12
- - **Processing API Compatibility**: Leverage the well-known Processing API to create stunning visuals, animations, and interactive applications using Ruby.
13
- - **Cross-Platform**: Works seamlessly on both macOS and Windows environments.
14
- - **Ruby-Powered**: Enjoy the elegance and simplicity of Ruby while crafting creative projects.
15
- - **Extensible and Open**: Modify and extend the library to fit your unique needs.
13
+ ### 🔄 Where to Contribute?
16
14
 
17
- ## Installation
15
+ All development happens in our [xord/all](https://github.com/xord/all) monorepo, which contains all our main libraries.
16
+ If you'd like to contribute, please submit your changes there.
18
17
 
19
- Install the gem via RubyGems:
18
+ For more details, check out our [Contribution Guidelines](./CONTRIBUTING.md).
20
19
 
21
- ```bash
22
- gem install reight
20
+ Thanks for your support! 🙌
21
+
22
+ ## 🚀 About
23
+
24
+ **Reight** is a small, fantasy-console-style game engine for Ruby. It runs a fixed **400 × 224** screen, a **32-color** palette, and an **8 × 8 pixel** chip / sprite size, and ships with built-in **sprite / map / sound** editors so you can author all assets without leaving the tool.
25
+
26
+ Under the hood it builds on the rest of the `xord/*` family — Reight's runtime is essentially [RubySketch](https://github.com/xord/rubysketch) (and [Processing](https://github.com/xord/processing) under it), restricted to a retro-friendly framebuffer and extended with project storage, a chunked tile map, a chip / tileset system, and an editing UI.
27
+
28
+ A project is just a directory of plain files:
29
+
30
+ ```
31
+ mygame/
32
+ ├── project.json # screen size, font, file names, ...
33
+ ├── game.rb # your game code (uses Reight's top-level API)
34
+ ├── chips.png # tileset image
35
+ ├── chips.json # tile metadata (shapes, sensors, ...)
36
+ ├── maps.json # tile-map data (chunked)
37
+ └── sounds.json # sound data
23
38
  ```
24
39
 
25
- Or add it to your Gemfile:
40
+ ## 📋 Requirements
26
41
 
42
+ - Ruby **3.0.0** or later
43
+ - All the runtime requirements of [Reflex](https://github.com/xord/reflex) (Rays, Rucy, Xot, plus the platform GUI backend — AppKit / UIKit / Win32 / SDL2 — and OpenGL)
44
+ - The dependent gems are installed automatically: `xot`, `rucy`, `beeps`, `rays`, `reflexion`, `processing`, `rubysketch`
45
+
46
+ There is no native C/C++ extension in this gem; the heavy lifting is done by the underlying gems' extensions.
47
+
48
+ ## 📦 Installation
49
+
50
+ Add this line to your Gemfile:
27
51
  ```ruby
28
52
  gem 'reight'
29
53
  ```
30
54
 
31
- Then run:
55
+ Then install:
56
+ ```bash
57
+ $ bundle install
58
+ ```
32
59
 
60
+ Or install it directly:
33
61
  ```bash
34
- bundle install
62
+ $ gem install reight
35
63
  ```
36
64
 
37
- ## Getting Started
65
+ The gem also installs a `r8` command-line tool used to run and edit projects.
66
+
67
+ ## ▶️ The `r8` command
68
+
69
+ ```bash
70
+ $ r8 [DIR] # run the project in DIR (default: current directory)
71
+ $ r8 --edit [DIR] # open the project in the built-in editor
72
+ $ r8 --help # show all options
73
+ ```
74
+
75
+ `DIR` is the project directory described above. If it does not contain a `project.json`, defaults are used.
76
+
77
+ ### Built-in editor screens
78
+
79
+ When launched with `--edit`, the engine adds these tabs alongside the game runner:
80
+
81
+ | Editor | Purpose | Tools (`lib/reight/app/<name>/`) |
82
+ | ------------ | ---------------------------------------------------------------- | -------------------------------- |
83
+ | **Sprite** | Pixel-art editor for the chip / tileset image (`chips.png`) | brush, fill, color picker, line, rect / shape, select |
84
+ | **Map** | Chunk-based tile-map editor | brush, line, rect |
85
+ | **Sound** | Waveform-based sound editor | brush, eraser |
86
+
87
+ The currently active tab is switched from the top navigator bar.
88
+
89
+ ## 📚 What's Provided
90
+
91
+ `require 'reight'` makes a refinement-based API available, much like Processing and RubySketch. The full **Processing + RubySketch** vocabulary is exposed at the top level (camelCase **and** snake_case aliases), and Reight adds the pieces below.
92
+
93
+ ### Reight-specific API
94
+
95
+ | API | Purpose |
96
+ | -------------------- | -------------------------------------------------------------------------------------------------------- |
97
+ | `project` | The active `Reight::Project` — accessors for `chips`, `maps`, `sounds`, project paths, font, etc. |
98
+ | `Reight::Sprite` | A subclass of `RubySketch::Sprite` carrying an optional `chip` and a per-instance `props` hash; default sprite class returned by `createSprite` inside Reight |
99
+ | `Reight::Chip` | A single tile from the tileset — `id`, position / size in `chips.png`, optional collision shape and sensor flag |
100
+ | `Reight::Map` | Chunk-based tile map (`chip_size: 8`, `chunk_size: 128` by default); `Enumerable`, with `to_sprites` and live `activate(x, y, w, h, world)` for visible regions |
101
+ | `Reight::Sound` | Persistent sound asset, edited by the Sound editor |
102
+ | `Reight::Project` | Loads and saves the JSON / PNG files described above |
103
+
104
+ ### Constants on `Reight::App`
105
+
106
+ | Constant | Value | Meaning |
107
+ | ------------------- | ---------- | -------------------------------------------------------------------- |
108
+ | `SCREEN_WIDTH` | `400` | Fixed framebuffer width |
109
+ | `SCREEN_HEIGHT` | `224` | Fixed framebuffer height |
110
+ | `PALETTE_COLORS` | 32 entries | Default 32-color hex palette (transparent first, then a PICO-8-flavored set) |
38
111
 
39
- Here’s a simple example to get you started:
112
+ The window opens at `3×` the framebuffer size by default; the framebuffer is upscaled with no smoothing for a crisp pixel-art look.
113
+
114
+ ## 💡 Usage
115
+
116
+ ### Minimal `game.rb`
40
117
 
41
118
  ```ruby
42
- # Create a window and draw something
43
119
  draw do
44
120
  background 0
45
- $sprites ||= project.maps.first.map(&:to_sprite)
46
- sprite $sprites
121
+ fill 1
122
+ text 'hello, reight!', 10, 100
47
123
  end
48
124
  ```
49
125
 
50
- Run the script and watch your window come to life!
126
+ Run it from the project directory:
51
127
 
52
128
  ```bash
53
- $ bundle exec r8 --edit .
129
+ $ r8 .
54
130
  ```
55
131
 
56
- You can find example projects in [xord/reight-examples](https://github.com/xord/reight-examples).
132
+ ### Move a sprite with the cursor keys
133
+
134
+ ```ruby
135
+ player = createSprite 200, 112, 8, 8
136
+
137
+ player.update do
138
+ player.x += 1 if key_is_down(RIGHT)
139
+ player.x -= 1 if key_is_down(LEFT)
140
+ end
141
+
142
+ draw do
143
+ background 0
144
+ sprite player
145
+ end
146
+ ```
57
147
 
58
- ## Documentation
148
+ ### Draw the first map of the project
59
149
 
60
- Comprehensive documentation and guides can be found [here](https://www.rubydoc.info/gems/reight/).
150
+ ```ruby
151
+ draw do
152
+ background 0
153
+ $sprites ||= project.maps.first.to_sprites
154
+ sprite *$sprites
155
+ end
156
+ ```
157
+
158
+ (Open `r8 --edit .` first to draw the map, then run `r8 .` to play it.)
159
+
160
+ ### Use chip properties
161
+
162
+ Chips have a `props` hash you can read from your game code:
163
+
164
+ ```ruby
165
+ $sprites ||= project.maps.first.to_sprites.each do |sp|
166
+ sp.dynamic = true if sp.chip.props[:dynamic]
167
+ end
168
+ ```
169
+
170
+ ## 🛠️ Development
171
+
172
+ ```bash
173
+ $ rake test # run the test suite
174
+ $ rake doc # generate YARD docs
175
+ $ rake # default tasks
176
+ ```
61
177
 
62
- ## License
178
+ In the [`xord/all`](https://github.com/xord/all) monorepo you can scope by module, e.g. `rake reight test`.
63
179
 
64
- This project is licensed under the [MIT License](LICENSE).
180
+ There is also a WASM build pipeline under [`wasm/`](./wasm) that packages the engine and your project for the browser via Emscripten + ruby.wasm.
65
181
 
66
- ---
182
+ ## 📜 License
67
183
 
68
- Happy coding with Ruby and Processing!
184
+ **Reight** is licensed under the MIT License.
185
+ See the [LICENSE](./LICENSE) file for details.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.18
1
+ 0.2.0
data/reight.gemspec CHANGED
@@ -25,13 +25,13 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_dependency 'xot', '~> 0.3.12'
29
- s.add_dependency 'rucy', '~> 0.3.12'
30
- s.add_dependency 'beeps', '~> 0.3.12'
31
- s.add_dependency 'rays', '~> 0.3.12'
32
- s.add_dependency 'reflexion', '~> 0.3.15'
33
- s.add_dependency 'processing', '~> 1.1.18'
34
- s.add_dependency 'rubysketch', '~> 0.7.19'
28
+ s.add_dependency 'xot', '~> 0.3.13'
29
+ s.add_dependency 'rucy', '~> 0.3.13'
30
+ s.add_dependency 'beeps', '~> 0.3.13'
31
+ s.add_dependency 'rays', '~> 0.3.13'
32
+ s.add_dependency 'reflexion', '~> 0.4.0'
33
+ s.add_dependency 'processing', '~> 1.2.0'
34
+ s.add_dependency 'rubysketch', '~> 0.8.0'
35
35
 
36
36
  s.files = `git ls-files`.split $/
37
37
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reight
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.18
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-05-09 00:00:00.000000000 Z
11
+ date: 2026-05-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -16,98 +16,98 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.3.12
19
+ version: 0.3.13
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.3.12
26
+ version: 0.3.13
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rucy
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 0.3.12
33
+ version: 0.3.13
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 0.3.12
40
+ version: 0.3.13
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: beeps
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.3.12
47
+ version: 0.3.13
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.3.12
54
+ version: 0.3.13
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rays
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.3.12
61
+ version: 0.3.13
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.3.12
68
+ version: 0.3.13
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: reflexion
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.3.15
75
+ version: 0.4.0
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.3.15
82
+ version: 0.4.0
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: processing
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 1.1.18
89
+ version: 1.2.0
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 1.1.18
96
+ version: 1.2.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rubysketch
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: 0.7.19
103
+ version: 0.8.0
104
104
  type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: 0.7.19
110
+ version: 0.8.0
111
111
  description: A Retro Game Engine for Ruby.
112
112
  email: xordog@gmail.com
113
113
  executables: