diff options
Diffstat (limited to 'deploy_template/mygame/documentation/99-todo.md')
| -rw-r--r-- | deploy_template/mygame/documentation/99-todo.md | 89 |
1 files changed, 0 insertions, 89 deletions
diff --git a/deploy_template/mygame/documentation/99-todo.md b/deploy_template/mygame/documentation/99-todo.md deleted file mode 100644 index f02df2d..0000000 --- a/deploy_template/mygame/documentation/99-todo.md +++ /dev/null @@ -1,89 +0,0 @@ -# Documentation That Needs to be Organized - -## Class macro attr_gtk - -Use the `attr_gtk` class method to help access the different variables provided via `args`: - -```ruby -class Game - attr_gtk - attr_accessor :current_scene, :other_custom_attrs - - def tick - end -end - -$game = Game.new - -def tick args - $game.args = args - $game.tick -end -``` - -The code above is the similar to: - -```ruby -class Game - attr_accessor :args, :grid, :state, :inputs, :outputs, :gtk, :passes, - :current_scene, :other_custom_attrs - - def tick - end -end - -$game = Game.new - -def tick args - $game.args = args - $game.grid = args.grid - $game.state = args.state - $game.outputs = args.outputs - $game.gtk = args.gtk - $game.passes = args.passes - $game.tick -end -``` - -## Monkey patching the runtime - -You're on your own if you do this :grimacing: - -```ruby -module GTK - class Runtime - alias_method :__original_tick_core__, :tick_core unless Runtime.instance_methods.include?(:__original_tick_core__) - - def tick_core - __original_tick_core__ - $top_level.oh @args - $top_level.god @args - $top_level.why @args - end - end -end - -def tick args -end - -def oh args -end - -def god args -end - -def why args -end -``` - -## MP3's to Wav converstion script: - -```ruby -`ls .`.each_line.to_a.map do |l| - l = l.strip - if l.end_with? "mp3" - `ffmpeg -i #{l} -acodec pcm_s16le -ar 44100 prep-#{l.split(".")[0]}.wav` - `ffmpeg -y -i prep-#{l.split(".")[0]}.wav -f wav -bitexact -acodec pcm_s16le -ar 44100 -ac 1 #{l.split(".")[0]}.wav` - end -end -``` |
