Class: Game

Inherits:
Chingu::Window
  • Object
show all
Defined in:
lib/prkwars/game.rb

Overview

Game class which is reponsible for the whole game logic - generation of the game space, generation of enemies and checking collisions between them, destroying objects or reducing their HP if necessary.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeGame

Returns a new instance of Game.



11
12
13
14
15
# File 'lib/prkwars/game.rb', line 11

def initialize
  super(1280, 720)
  # push_game_state(Play)
  push_game_state(Splash)
end

Instance Attribute Details

#gamespaceObject (readonly)

Returns the value of attribute gamespace.



9
10
11
# File 'lib/prkwars/game.rb', line 9

def gamespace
  @gamespace
end

#playerObject (readonly)

Returns the value of attribute player.



9
10
11
# File 'lib/prkwars/game.rb', line 9

def player
  @player
end