This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jay@dandelion:~/Projects/gemini.fresh | |
$ ./run-specs.sh | |
(in /Users/jay/Projects/gemini.fresh) | |
** Invoke spec (first_time) | |
** Execute spec | |
./src/behavior.rb:62:in `class_eval': ./src/behavior.rb:68: , | |
unexpected tRPAREN (SyntaxError) | |
from ./src/behavior.rb:62:in `method_added' | |
from ./src/behaviors/spatial.rb:4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'listenable_mixin' | |
module Gemini | |
class MethodExistsError < Exception; end | |
class InvalidWrapWithCallbacksError < Exception; end | |
class ValueChangedEvent | |
attr_accessor :previous_value, :desired_value | |
def initialize(previous_value, desired_value) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./run-specs.sh | |
(in /Users/jay/Projects/gemini.fresh) | |
** Invoke spec (first_time) | |
** Execute spec | |
Failed to evaluate code: | |
def position=(*arg1) | |
raise Gemini::InvalidWrapWithCallbacksError.new("Cannot wrap position= with callbacks without \"position\"") unless respond_to?(:position) | |
event = ValueChangedEvent.new(@target.position, *arg1) | |
callback_abort = CallbackStatus.new | |
@target.notify :before_position_changes, event |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://gist.github.com/169491 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jay@dandelion:~/Projects/gemini.fresh | |
$ ./run-specs.sh | |
(in /Users/jay/Projects/gemini.fresh) | |
** Invoke spec (first_time) | |
** Execute spec | |
.......*......................Creating Rawr configuration file build_configuration.rb | |
build_configuration.rb | |
Creating Java class /Users/jay/Projects/gemini.fresh/spec_tmp/src/org/rubyforge/rawr/Main.java | |
Creating Rakefile ... | |
.......Creating Rawr configuration file build_configuration.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'managers/basic_game_object_manager' | |
describe 'BasicGameObjectManager' do | |
before :each do | |
@state = Jemini::BaseState.new(mock('Container', :null_object => true), mock('Game', :null_object => true)) | |
@manager = BasicGameObjectManager.new(@state) | |
@state.send(:set_manager, :game_object, @manager) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'spec_helper' | |
require 'managers/basic_game_object_manager' | |
describe 'BasicGameObjectManager' do | |
before :each do | |
@state = Jemini::BaseState.new(mock('Container', :null_object => true), mock('Game', :null_object => true)) | |
@manager = BasicGameObjectManager.new(@state) | |
@state.send(:set_manager, :game_object, @manager) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ShellShooter < Jemini::Behavior | |
POWER_FACTOR = 120.0 | |
def fire_weapon(power, angle) | |
begin | |
#TODO: configurable fire_from_distance to replace barrel anchor | |
shell = @target.game_state.create :Shell | |
# shell_offset = @target.barrel_anchor + Vector.new(0.0, -5.0 + @target.barrel_anchor.y) | |
shell_offset = Vector.new(0.0, -5.0 - @target.barrel_width) | |
shell_position = shell_offset.pivot_around_degrees(Vector::ORIGIN, @target.physical_rotation + angle) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//gist.github.com/206570 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shell < Jemini::GameObject | |
has_behavior :PhysicalSprite | |
has_behavior :Taggable | |
has_behavior :TriangleTrailEmittable | |
attr_accessor :damage | |
@@active_shells = [] | |
VELOCITY_TO_DAMAGE_RATIO = 0.05 |