Can we see your player.rb code? I suspect that you are not correctly
passing the game window to Gosu::Image when creating your player icon
object.
def initialize(game_window)
@game_window = game_window
@icon = Gosu::Image.new(@game_window, "images/player1.png",
true)
On Mar 11, 9:57 am, MaK <
mahyar.koshko...@gmail.com> wrote:
> Hi,
>
> I keep getting this error and i'm only on the second screencast:
>
> D:/Files/Projects/Ruby/game 1/player.rb:4:in `initialize': invalid
> null referenc
> e Expected argument 0 of type Gosu::Window &, but got NilClass nil
> (ArgumentErro
> r)
> in SWIG method 'Gosu::Image'
> from D:/Files/Projects/Ruby/game 1/player.rb:4:in `new'
> from D:/Files/Projects/Ruby/game 1/player.rb:4:in `initialize'
> from my_game.rb:9:in `new'
> from my_game.rb:9:in `initialize'
> from my_game.rb:21:in `new'
> from my_game.rb:21:in `<main>'
>
> I'm on windows XP with ruby 1.9.2. The code is exactly as in the
> video.
>
> MaK