mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Update Boot/Close to use Menu constants
This commit is contained in:
@@ -1,14 +1,6 @@
|
|||||||
class IMICFPS
|
class IMICFPS
|
||||||
class Boot < GameState
|
class Boot < GameState
|
||||||
def setup
|
def setup
|
||||||
@primary_color = Gosu::Color.rgba(255, 127, 0, 200)
|
|
||||||
@accent_color = Gosu::Color.rgba(155, 27, 0, 200)
|
|
||||||
|
|
||||||
@color_step = 10
|
|
||||||
@transparency = 200
|
|
||||||
@bar_size = 50
|
|
||||||
@slope = 250
|
|
||||||
|
|
||||||
@title = Text.new(IMICFPS::NAME, size: 100, z: 0, color: Gosu::Color.new(0xff000000), shadow: false, font: "Droid Serif")
|
@title = Text.new(IMICFPS::NAME, size: 100, z: 0, color: Gosu::Color.new(0xff000000), shadow: false, font: "Droid Serif")
|
||||||
@logo = get_image(IMICFPS::GAME_ROOT_PATH + "/static/logo.png")
|
@logo = get_image(IMICFPS::GAME_ROOT_PATH + "/static/logo.png")
|
||||||
|
|
||||||
@@ -19,10 +11,10 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
menu_background(@primary_color, @accent_color, @color_step, @transparency, @bar_size, @slope)
|
|
||||||
|
|
||||||
fraction_left = ((Gosu.milliseconds - @start_time) / (@time_to_live - 200).to_f)
|
fraction_left = ((Gosu.milliseconds - @start_time) / (@time_to_live - 200).to_f)
|
||||||
|
|
||||||
|
menu_background(Menu::PRIMARY_COLOR, Menu::ACCENT_COLOR, Menu::BAR_COLOR_STEP, Menu::BAR_ALPHA, Menu::BAR_SIZE, Menu::BAR_SLOPE)
|
||||||
|
|
||||||
if fraction_left <= 1.0
|
if fraction_left <= 1.0
|
||||||
Gosu.draw_circle(
|
Gosu.draw_circle(
|
||||||
window.width / 2,
|
window.width / 2,
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
class IMICFPS
|
class IMICFPS
|
||||||
class Close < GameState
|
class Close < GameState
|
||||||
def setup
|
def setup
|
||||||
@primary_color = Gosu::Color.rgba(255, 127, 0, 200)
|
@slope = Menu::BAR_SLOPE
|
||||||
@accent_color = Gosu::Color.rgba(155, 27, 0, 200)
|
|
||||||
|
|
||||||
@color_step = 10
|
|
||||||
@transparency = 200
|
|
||||||
@bar_size = 50
|
|
||||||
@slope = 250
|
|
||||||
|
|
||||||
@logo = get_image(IMICFPS::GAME_ROOT_PATH + "/static/logo.png")
|
@logo = get_image(IMICFPS::GAME_ROOT_PATH + "/static/logo.png")
|
||||||
|
|
||||||
@@ -18,16 +12,9 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw
|
def draw
|
||||||
menu_background(@primary_color, @color_step, @transparency, @bar_size, @slope.round)
|
|
||||||
|
|
||||||
fraction_left = 1 - ((Gosu.milliseconds - @start_time) / (@time_to_live - 200).to_f)
|
fraction_left = 1 - ((Gosu.milliseconds - @start_time) / (@time_to_live - 200).to_f)
|
||||||
|
|
||||||
Gosu.draw_quad(
|
menu_background(Menu::PRIMARY_COLOR, Menu::ACCENT_COLOR, Menu::BAR_COLOR_STEP, Menu::BAR_ALPHA, Menu::BAR_SIZE, @slope.round)
|
||||||
0, 0, @primary_color,
|
|
||||||
window.width, 0, @primary_color,
|
|
||||||
window.width, window.height, @accent_color,
|
|
||||||
0, window.height, @accent_color
|
|
||||||
)
|
|
||||||
|
|
||||||
Gosu.draw_circle(
|
Gosu.draw_circle(
|
||||||
window.width / 2,
|
window.width / 2,
|
||||||
|
|||||||
Reference in New Issue
Block a user