Closed TheGrogor closed 12 years ago
Help file says:
Now, we're almost ready to try this again. I need to go to the MyGame class first, and I need to instantiate this player. I do this by typing in the initialize method: @player1 = Player.new(game_window) This tells the player which window to draw itself on.
Now, we're almost ready to try this again. I need to go to the MyGame class first, and I need to instantiate this player.
I do this by typing in the initialize method:
@player1 = Player.new(game_window) This tells the player which window to draw itself on.
this results in an error:
/var/folders/yv/yvh4VEXl2RWUgE+3+X2F+U+++TM/-Tmp-/kidcode.rb:9:in initialize': undefined local variable or methodgame_window' for # (NameError)
initialize': undefined local variable or method
Possible solution: replace @player1 = Player.new(game_window) with @player1 = Player.new(self)
Fix by this commit: https://github.com/hybridgroup/kidsruby/commit/2b58b95e286a88eef37835bc2c1d540ed82e5775
Help file says:
this results in an error:
Possible solution: replace @player1 = Player.new(game_window) with @player1 = Player.new(self)