Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby Game Development

Ruby Game Development

Palestra ministrada na Rubyconf 2015

Andre Luis Anastacio

September 19, 2015
Tweet

More Decks by Andre Luis Anastacio

Other Decks in Programming

Transcript

  1. André Luís Anastácio
    23 - andreanastacio.com.br - @ndrluis
    Desenvolvedor Irado

    View full-size slide

  2. RPG Maker
    RGSS
    Ruby Game Scripting System

    View full-size slide

  3. Ruby MRI
    Gosu
    Chingu - ndrluis/chingu
    Exemplo - ndrluis/ld-32

    View full-size slide

  4. Javascript
    Phaser.io / Babylon.js / Quintus / Impact
    Crafty.js / Melon.js / PIXI.js

    View full-size slide

  5. Opal - Transpiler Ruby -> JS
    Dare - domgetter/dare
    Opal Phaser - orbitalimpact/opal-phaser
    Pong Example - OpenGameDev/pong-opal-phaser

    View full-size slide

  6. Mas fazer jogos para desktop
    está fora de moda, quero jogos
    para mobile.

    View full-size slide

  7. Crosswalk Project
    https://crosswalk-project.org

    View full-size slide

  8. Rubymotion
    HipByte/RubyMotionSamples

    View full-size slide

  9. Fazer Games exercita a inovação

    View full-size slide

  10. GameJams exercitam o espirito
    Hacker

    View full-size slide

  11. class Grass < GameObject
    traits :bounding_box, :collision_detection
    def setup
    @image = Image["#{self.filename}.png"]
    self.rotation_center = :top_left
    end
    def self.solid
    all.select { |block| block.alpha == 255 }
    end
    def self.inside_viewport
    all.select { |block| block.game_state.viewport.inside?(block) }
    end
    end

    View full-size slide

  12. class GrassTiles
    include Chingu::NamedResource
    def initialize
    @builded_classes = build_classes
    end
    def all
    @builded_classes.flat_map(&:all)
    end
    private
    def build_classes
    class_names.map do |class_name|
    Class.new(Grass).tap do |klass|
    Object.const_set class_name, klass
    end
    end
    end
    def class_names
    Dir.glob(File.join(ROOT, 'media', 'grass_*.png')).map do |f|
    File.basename(f, '.png').split("_").each {|s| s.capitalize! }.join("")
    end
    end
    end

    View full-size slide

  13. LightTable
    Chris Granger - http://bit.ly/1V1qfFg

    View full-size slide

  14. Obrigado!
    Twitter / Github - @ndrluis

    View full-size slide