mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Added HUD widgets, make Boot and Close use button_up instead of button_down
This commit is contained in:
@@ -57,7 +57,7 @@ class IMICFPS
|
||||
push_state(MainMenu) if Gosu.milliseconds - @start_time >= @time_to_live
|
||||
end
|
||||
|
||||
def button_down(id)
|
||||
def button_up(id)
|
||||
if id == Gosu::KbEscape or
|
||||
(id >= Gosu::GP_LEFT and id >= Gosu::GP_BUTTON_15) or
|
||||
id == Gosu::MsLeft
|
||||
|
||||
@@ -51,7 +51,7 @@ class IMICFPS
|
||||
@slope -= 25 * window.dt
|
||||
end
|
||||
|
||||
def button_down(id)
|
||||
def button_up(id)
|
||||
if id == Gosu::KbEscape or
|
||||
(id >= Gosu::GP_LEFT and id >= Gosu::GP_BUTTON_15) or
|
||||
id == Gosu::MsLeft
|
||||
|
||||
@@ -12,6 +12,7 @@ class IMICFPS
|
||||
@director = Networking::Director.new(mode: :memory, hostname: "i-mic.rubyclan.org", port: 56789, interface: { server: Networking::MemoryServer, connection: Networking::MemoryConnection }, state: self)
|
||||
|
||||
@crosshair = Crosshair.new
|
||||
@hud = HUD.new(@player)
|
||||
|
||||
@text = Text.new("Pending...", x: 10, y: 22, z: 1, size: 18, font: "DejaVu Sans", shadow_color: Gosu::Color::BLACK)
|
||||
|
||||
@@ -27,6 +28,7 @@ class IMICFPS
|
||||
@map.render(@camera)
|
||||
|
||||
@crosshair.draw
|
||||
@hud.draw
|
||||
@text.draw
|
||||
end
|
||||
|
||||
@@ -38,6 +40,7 @@ class IMICFPS
|
||||
@map.update
|
||||
|
||||
control_player
|
||||
@hud.update
|
||||
|
||||
@camera.update
|
||||
@director.tick(window.dt)
|
||||
|
||||
Reference in New Issue
Block a user