Class: SnakeGame::ImageDatabase

Inherits:
Object
  • Object
show all
Defined in:
lib/image_database.rb

Overview

Class providing images to other classes

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeImageDatabase

Returns a new instance of ImageDatabase.



7
8
9
10
11
12
# File 'lib/image_database.rb', line 7

def initialize
  # puts Dir.pwd
  @head = Gosu::Image.new('lib/images/head.png')
  @tail = Gosu::Image.new('lib/images/tail.png')
  @bait = Gosu::Image.new('lib/images/bait.png')
end

Instance Attribute Details

#baitObject

Returns the value of attribute bait.



6
7
8
# File 'lib/image_database.rb', line 6

def bait
  @bait
end

#headObject

Returns the value of attribute head.



6
7
8
# File 'lib/image_database.rb', line 6

def head
  @head
end

#tailObject

Returns the value of attribute tail.



6
7
8
# File 'lib/image_database.rb', line 6

def tail
  @tail
end