Skip to content

Instantly share code, notes, and snippets.

@xord
xord / grant-2024.md
Last active March 19, 2025 14:58
2024 年度 Ruby アソシエーション開発助成金 最終報告

2024年度 Ruby アソシエーション開発助成金 最終報告

1. はじめに

この資料は、「2024 年度 Ruby アソシエーション開発助成金」制度で採択された「Processing Gem ベースの 2D レトロゲームエンジンの開発」についての最終報告書になります。

2. プロジェクト概要

昨年度採択されたCRuby 用 Processing Gem の本家 Processing との互換性向上に向けた取り組みを基に、その成果物である Processing Gem をベースにして新たに 2Dレトロゲームエンジンの開発を行いました。

@xord
xord / shmup.rb
Created February 8, 2025 19:27
Reight シューティングゲームサンプル
def add_sp(array = nil, sp)
add_sprite sp
array&.push sp
sp
end
def delete_sp(array = nil, sp)
remove_sprite sp
array&.delete sp
sp
@xord
xord / grant-2024.md
Last active January 19, 2025 13:00
2024 年度 Ruby アソシエーション開発助成金 中間報告

2024年度 Ruby アソシエーション開発助成金 中間報告

1. はじめに

この資料は、「2024 年度 Ruby アソシエーション開発助成金」制度で採択された「Processing Gem ベースの 2D レトロゲームエンジンの開発」についての中間報告書になります。

2. プロジェクト概要

昨年度採択されたCRuby 用 Processing Gem の本家 Processing との互換性向上に向けた取り組みを基に、その成果物である Processing Gem をベースにして新たに 2Dレトロゲームエンジンの開発を行います。

@xord
xord / mml.rb
Created December 23, 2024 18:00
MML から Sequencer オブジェクト生成サンプル
require 'strscan'
require 'rubysketch'
using RubySketch
B = Beeps
class MMLCompiler
def compile(str)
scanner = StringScanner.new str.gsub(/;.*\n/, '')
@xord
xord / grant-2023.md
Last active March 15, 2024 15:56
2023 年度 Ruby アソシエーション開発助成金 最終報告

2023 年度 Ruby アソシエーション開発助成金 最終報告

1. はじめに

この資料は、「2023 年度 Ruby アソシエーション開発助成金」制度で採択された「CRuby 用 Processing Gem の、本家 Processing との互換性向上に向けた取り組み」についての最終報告書になります。

2. プロジェクトについて

2.1 概要

@xord
xord / grant-2023.md
Last active January 9, 2024 16:34
2023 年度 Ruby アソシエーション開発助成金 中間報告

2023 年度 Ruby アソシエーション開発助成金 中間報告

1. はじめに

この資料は、「2023 年度 Ruby アソシエーション開発助成金」制度で採択された「CRuby 用 Processing Gem の、本家 Processing との互換性向上に向けた取り組み」についての中間報告書になります。

2. プロジェクト概要

クリエイティブコーディングの世界では Processingp5.js のようなフレームワークが広く利用されています。これらを利用することで、フレームワーク利用者はグラフィックスと視覚的な表現を駆使したアートやインタラクティブなアプリケーションを簡単に作成することができます。

@xord
xord / ball_merge_game.rb
Created December 9, 2023 06:34
スイカゲーム風サンプル
require 'rubysketch'
using RubySketch
STEP = 20
SIZE_RANGE = 20..100
def nextSize()
SIZE_RANGE.step(STEP).to_a.sample
end
@xord
xord / toon3.rb
Created October 17, 2023 17:41
rubysketch gem で作ったパラパラ漫画アプリ
SAVE_PATH = 'ToonData'
class Button < Sprite
def initialize(w: 100, h: 44, label: nil, rgb: [200] * 3, &block)
super 0, 0, w, h
@label, @rgb, @select = label, rgb, false
pressing = false
includeMouse = ->x, y { (0...self.w).include?(x) && (0..self.h).include?(y) }
@xord
xord / toon2.rb
Created October 17, 2023 01:51
rubysketch gem で作ったパラパラ漫画アプリ
CHECKER_SHADER = createShader nil, <<END
varying vec4 vertPosition;
void main() {
float x = mod(vertPosition.x, 32.) / 16. - 1.;
float y = mod(vertPosition.y, 32.) / 16. - 1.;
float c = x * y >= 0. ? 0.8 : 0.7;
gl_FragColor = vec4(c, c, c, 1.);
}
END
@xord
xord / toon.rb
Created October 16, 2023 18:07
rubysketch gem で作ったパラパラ漫画アプリ
require 'rubysketch'
using RubySketch
class Canvas < Sprite
def initialize(width, height, scale: 1)
super 0, 0, width, height
@width, @height, @scale = width, height, scale