keyevents
E. Almqvist 3 years ago
parent 512e3fcde1
commit fd61000677
  1. 3
      src/app.rb
  2. 4
      src/config.rb
  3. 3
      src/lib/controller.rb
  4. 2
      src/lib/physobj.rb

@ -18,7 +18,7 @@ require_relative "lib/world.rb"
require_relative "ui/mainmenu.rb"
class Window < Gosu::Window
attr_accessor :caption, :ui, :world, :mainmenu, :key_events
attr_accessor :caption, :ui, :world, :mainmenu, :key_events, :up_keyhook, :down_keyhook
attr_reader :width, :height, :fonts
def initialize(title, width, height)
@ -40,6 +40,7 @@ class Window < Gosu::Window
@ui = []
@fonts = {
small: Gosu::Font.new(self, MAIN_FONT, 8),
normal: Gosu::Font.new(self, MAIN_FONT, 18),
big: Gosu::Font.new(self, MAIN_FONT, 20),
title: Gosu::Font.new(self, MAIN_FONT, 64),

@ -5,9 +5,9 @@ ENABLE_DEBUG = true
WORLD_SEED = 123456789
# UI
WINDOW_WIDTH = 1600
WINDOW_WIDTH = 1200
WINDOW_HEIGHT = 900
WINDOW_FULLSCREEN = false
WINDOW_FULLSCREEN = false
MAIN_FONT = "monospace"
# Keybinds

@ -8,9 +8,6 @@ class Player < PhysCube
# Bind all the binds to all the functions stuff
# world.down_keyhook.add()
# world.down_keyhook.add(:player, :toggle_engine, {
# puts("ENGINE TOGGLE :D")
# })
end

@ -58,7 +58,7 @@ class PhysObj
def render(x_offset=0, y_offset=0, color=Gosu::Color.argb(0xaa_2222ff))
if( @show_info ) then
self.world.fonts[:normal].draw_text(self.inspect, self.pos[0] + x_offset, self.pos[1] + y_offset, 1, 1.0, 1.0, color)
self.world.fonts[:small].draw_text(self.inspect, self.pos[0] + x_offset, self.pos[1] + y_offset, 1, 1.0, 1.0, color)
end
end

Loading…
Cancel
Save