Skip to content

Instantly share code, notes, and snippets.

View amirrajan's full-sized avatar
💭
Working on DragonRuby Game Toolkit and RubyMotion

Amir Rajan amirrajan

💭
Working on DragonRuby Game Toolkit and RubyMotion
View GitHub Profile
@amirrajan
amirrajan / main.rb
Created September 4, 2025 22:08
DragonRuby Game Toolkit - Star Perf Revisited
# Sprites represented as Hashes using the queue ~args.outputs.sprites~
# code up, but are the "slowest" to render.
# The reason for this is the access of the key in the Hash and also
# because the data args.outputs.sprites is cleared every tick.
def random_x
rand * $grid.w * -1
end
def random_y
@amirrajan
amirrajan / main.rb
Created August 30, 2025 23:50
DragonRuby Game Toolkit - Square Fall (Mult-orientation and Edge to Edge rendering) https://youtu.be/r1IrTdEUE0o
RED = { r: 222, g: 63, b: 66 }
GRAY = { r: 128, g: 128, b: 128 }
BLACK = { r: 0, g: 0, b: 0 }
LIGHT_GRAY = { r: 237, g: 237, b: 237 }
def boot args
args.state = {}
end
def tick args

Nissan Motors, and Their Crappy U.S. Made Transmissions

This is a work of fiction. Names, characters, places and incidents either are products of the author’s imagination or are used fictitiously. Any resemblance to actual events or locales or persons or companies (or anything else not explicity stated in this ridiculous disclaimer), living or dead, is entirely coincidental.

In the 1960’s, Nissan Motors expanded its market to the United States. In doing so, a portion of parts were to be built on American soil. Around this same time period, automotive innovation was in full force. Specifically with regard to automatic transmissions. An extremely bright team of American and Japanese engineers got together and spec’d out the first line of automatic transmissions to be used in Nissan automobiles.

The specifications for the new automatic transmissions were sent to the production lines in the United States and Japan. The transmissions were complex, 863 unique parts needed to be assembled for this incredible piec

@amirrajan
amirrajan / main.rb
Created August 7, 2025 07:02
DragonRuby Game Toolkit: Easing Fubar
def tick args
duration = 120
args.state.after_image_queue ||= []
args.state.start_at = if Kernel.tick_count == 0
0
elsif Kernel.tick_count.zmod?(duration.idiv(2))
args.state.start_at + duration.idiv(2)
else
args.state.start_at
end
@amirrajan
amirrajan / 00_preview.md
Last active August 7, 2025 01:42
DragonRuby - Cube World
cube-world-720p.mp4
@amirrajan
amirrajan / 00_preview.md
Created August 6, 2025 21:54
DragonRuby Game Toolkit - Rinoa Final Fantasy 8
riona-720p.mp4
@amirrajan
amirrajan / info.md
Created July 28, 2025 17:22
DragonRuby - Nidhoog
@amirrajan
amirrajan / Main-01.0.cs
Last active July 27, 2025 22:06
"Clever" C#
public class Person
{
private string _firstName;
private string _lastName;
public Person(string lastName)
{
_firstName = "None";
_lastName = _lastName;
}
@amirrajan
amirrajan / main.rb
Last active July 22, 2025 23:31
DragonRuby Game Toolkit - I Have A Jet Pack (https://amirrajan.itch.io/i-have-a-jetpack)
class Game
attr :args
def tick
defaults
current_scene = state.scene
calc
render
state.clock += 1
if current_scene != state.scene
@amirrajan
amirrajan / main.rb
Last active July 9, 2025 19:48
DragonRuby Game Toolkit - check boxes with save and load
def boot args
# initialize args.state to an empty hash on boot
args.state = {}
end
def tick args
defaults args
calc args
render args
end