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 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
@amirrajan
amirrajan / he-who-fights-with-monsters.org
Last active July 8, 2025 04:41
He Who Fights With Monsters

Jason’s Essence Abilities.

The following is a list of Jason’s essence abilities as of gold rank. The list is written for brevity (believe it or not) rather than accuracy or comprehensiveness.

Dark Essence

Path of Shadows (special ability)

Iron: Teleport through a shadow to another visible shadow.

Bronze: Create portals across regional distances.

Silver: Create portals across continental distances.

@amirrajan
amirrajan / main.cs
Last active June 30, 2025 22:29
C# method missing
public class Person : Gemini
{
//define a method called MethodMissing taking in one parameter
dynamic MethodMissing(dynamic callInfo)
{
//check to see if the method being called ends in Html
if(callInfo.Name.EndsWith("Html"))
{
//if it does, add a method on the fly that returns
//the html encoded version of the parsed property
@amirrajan
amirrajan / main.rb
Last active June 29, 2025 19:41
DragonRuby Game Toolkit - Hooke's Law, Coulomb's Law
def boot args
args.state = {}
end
def tick args
args.state.center_screen ||= { x: 640, y: 360 }
args.state.particles ||= [
{ x: 300,
y: 300,
w: 16,