-
Notifications
You must be signed in to change notification settings - Fork 0
/
background.rb
38 lines (35 loc) · 942 Bytes
/
background.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
require 'gosu'
class Background
def initialize
@image = Gosu::Image.new("media/cell.bmp", :tileable=>true)
@outer_color = Gosu::Color.argb(0xff_202020)
@border_color = Gosu::Color::WHITE
@inner_color = Gosu::Color::BLACK
end
def draw
@image.draw(
0, 0,
0,
Config::WINDOW_X * Config::CELL_SCALE,
Config::WINDOW_Y * Config::CELL_SCALE,
@outer_color
)
@image.draw(
(Config::OFFSET_X - 1),
(Config::OFFSET_Y - 1),
0,
(Config::CELLS_WIDTH * Config::CELL_SCALE) + 0.2,
(Config::CELLS_HEIGHT * Config::CELL_SCALE) + 0.2,
@border_color,
)
@image.draw(
(Config::OFFSET_X),
(Config::OFFSET_Y),
0,
(Config::CELLS_WIDTH * Config::CELL_SCALE),
(Config::CELLS_HEIGHT * Config::CELL_SCALE),
@inner_color,
)
#@image.draw(0, 0, 2, Config::WINDOW_X, Config::WINDOW_Y, @outer_color)
end
end