Class: Logic::BaseLogic
- Inherits:
-
Object
- Object
- Logic::BaseLogic
- Extended by:
- Forwardable
- Defined in:
- lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb
Overview
Base logic class for the game’s logic elements.
Instance Attribute Summary collapse
-
#:game ⇒ Logic::Game
readonly
Game’s main logic/rules.
-
#game ⇒ Object
readonly
Returns the value of attribute game.
-
#height ⇒ Object
Returns the value of attribute height.
-
#width ⇒ Object
Returns the value of attribute width.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #initialize(**attrs) ⇒ BaseLogic constructor
Constructor Details
#initialize(**attrs) ⇒ BaseLogic
28 29 30 31 32 33 34 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 28 def initialize(**attrs) @game = attrs[:game] @width = attrs[:width] @height = attrs[:height] @x = attrs[:x] @y = attrs[:y] end |
Instance Attribute Details
#:game ⇒ Logic::Game (readonly)
Game’s main logic/rules
17 18 19 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 17
def :game
@:game
end
|
#game ⇒ Object (readonly)
Returns the value of attribute game.
20 21 22 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 20 def game @game end |
#height ⇒ Object
Returns the value of attribute height.
21 22 23 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 21 def height @height end |
#width ⇒ Object
Returns the value of attribute width.
21 22 23 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 21 def width @width end |
#x ⇒ Object
Returns the value of attribute x.
21 22 23 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 21 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
21 22 23 |
# File 'lib/games_paradise/flappy_bird/ruby2d/logic/base_logic.rb', line 21 def y @y end |