Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

extracted more rubygame/sdl facades

  • Loading branch information...
commit 9584e23aae1337a25b4f51ea8e3f55bbdbadc031 1 parent ff42d2d
@bgoodspeed authored
View
5 lib/facades/clock_facade.rb
@@ -0,0 +1,5 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+class ClockFacade < Rubygame::Clock
+end
View
9 lib/facades/event_queue_facade.rb
@@ -0,0 +1,9 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+class EventQueueFacade < Rubygame::EventQueue
+
+ def ignore_mouse_movement
+ self.ignore = [Rubygame::Events::MouseMoved]
+ end
+end
View
6 lib/facades/screen_facade.rb
@@ -0,0 +1,6 @@
+# To change this template, choose Tools | Templates
+# and open the template in the editor.
+
+class ScreenFacade < Rubygame::Screen
+
+end
View
13 lib/factories/game_internals_factory.rb
@@ -1,10 +1,5 @@
class GameInternalsFactory
- include Rubygame
- include Rubygame::Events
- include Rubygame::EventActions
- include Rubygame::EventTriggers
-
def make_event_system(game, always_on_hooks, menu_killed_hooks, menu_active_hooks, battle_hooks, battle_layer_hooks, player_hooks, npc_hooks)
EventSystem.new(make_clock, make_queue, make_event_hooks(game, always_on_hooks, menu_killed_hooks, menu_active_hooks, battle_hooks, battle_layer_hooks, player_hooks, npc_hooks))
end
@@ -12,12 +7,12 @@ def make_event_system(game, always_on_hooks, menu_killed_hooks, menu_active_hook
def make_screen
#@screen = Screen.open( [640, 480] )
- screen = Screen.new([@@SCREEN_X, @@SCREEN_Y])
+ screen = ScreenFacade.new([@@SCREEN_X, @@SCREEN_Y])
screen.title = @@GAME_TITLE
screen
end
def make_clock
- clock = Clock.new()
+ clock = ClockFacade.new()
clock.target_framerate = 50
clock.calibrate
clock.enable_tick_events
@@ -25,10 +20,10 @@ def make_clock
end
def make_queue
- queue = EventQueue.new()
+ queue = EventQueueFacade.new()
queue.enable_new_style_events
+ queue.ignore_mouse_movement
- queue.ignore = [MouseMoved]
queue
end
View
3  lib/game_requirements.rb
@@ -3,6 +3,9 @@
+require 'lib/facades/screen_facade'
+require 'lib/facades/clock_facade'
+require 'lib/facades/event_queue_facade'
require 'lib/facades/surface_facade'
require 'lib/facades/music_facade'
require 'lib/facades/sound_facade'
Please sign in to comment.
Something went wrong with that request. Please try again.