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 / explanation.md
Created August 7, 2019 18:24 — forked from AnanthVivekanand/explanation.md
Basic sound synth using SDL_audio, with some examples of frequency manipulation on a sine wave.
	SDL_Init(SDL_INIT_AUDIO);
	SDL_AudioSpec spec, aspec;
	SDL_zero(spec);
	spec.freq = 48000; //declare specs
	spec.format = AUDIO_S16SYS;
	spec.channels = 1;
	spec.samples = 4096;
	spec.callback = callback;
	spec.userdata = NULL;
@amirrajan
amirrajan / main.rb
Created January 16, 2024 07:31
DragonRuby Game Toolkit - Bullet Hell
class ShopScene
attr_gtk
def activate
state.module_selected = nil
state.available_modules = state.modules.shuffle.take(3)
state.available_module_1 = state.available_modules[0]
state.available_module_2 = state.available_modules[1]
state.available_module_3 = state.available_modules[2]
end
@amirrajan
amirrajan / main.rb
Created March 23, 2024 14:51
DragonRuby Game Toolkit - Random Hack and Slash
class Game
attr_gtk
def request_action name, at: nil
at ||= state.tick_count
state.player.requested_action = name
state.player.requested_action_at = at
end
def new_player
@amirrajan
amirrajan / 00.md
Last active April 15, 2024 05:35
Flappy Bird - DragonRuby Game Toolkit: Apples to Apples
apples-to-apples.mp4
nani.mp4
@amirrajan
amirrajan / Program.cs
Last active April 5, 2024 12:45
C# Dynamic
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Collections;
using System.Diagnostics;
using System.Dynamic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text;
@amirrajan
amirrajan / tutorial.html
Created March 24, 2024 05:00
DragonRuby Fiddle Tutorial Example
<html>
<head>
<title>DragonRuby - Warp Drive Tutorial</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/styles/default.min.css" />
<script src="//cdnjs.cloudflare.com/ajax/libs/highlight.js/10.0.3/highlight.min.js"></script>
<script src="tutorial.js"></script>
<link rel="stylesheet" href="tutorial.css" />
</head>
<body>
@amirrajan
amirrajan / main.rb
Last active March 13, 2024 05:28
Ruby - Pythagorean Triples
# all unique pythagorean triples
# sorted by area
# range of numbers we are checking
one_to_hundred = (1..100).to_a
# ==================================================
# OPTION 1: vanilla/intertwined logic -> bleh
# ==================================================
triples = Set.new