ippa/chingu — Issue #43: Problem with accessing namespaces
Author: pusewicz
Created: 2012-01-01 14:19:20+00:00
State: open

Hi:

/Users/piotr/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bundler/gems/chingu-962ef58b03bc/lib/chingu/game_states/enter_name.rb:66:in `initialize': uninitialized constant Chingu::GameStates::EnterName::Color (NameError)
from /Users/piotr/Work/GitHub/apocalypse/lib/apocalypse/game_window.rb:8:in `new'
from /Users/piotr/Work/GitHub/apocalypse/lib/apocalypse/game_window.rb:8:in `initialise'

And this is the code:

require 'chingu'

module Apocalypse
class GameWindow < Chingu::Window
def initialize
super

push_game_state GameStates::EnterName.new(:callback => method(:add))
end

def add(name)
puts "User entered name #{name}"
end
end
end

I think it would be better if Chingu address the absolute namespaces in the code e.g.:

@texts[@index].color = ::Gosu::Color::RED

instead of

@texts[@index].color = Color::RED