-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathmy_game.rb
More file actions
38 lines (28 loc) · 785 Bytes
/
my_game.rb
File metadata and controls
38 lines (28 loc) · 785 Bytes
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
##
# Copyright 2012, Prylis Incorporated.
#
# This file is part of The Ruby Entity-Component Framework.
# https://github.com/cpowell/ruby-entity-component-framework
# You can redistribute and/or modify this software only in accordance with
# the terms found in the "LICENSE" file included with the framework.
java_import com.badlogic.gdx.Game
require 'startup_state'
class MyGame < Game
include ApplicationListener
attr_reader :game_clock, :is_running
GAME_CLOCK_MULTIPLIER=1
def initialize
@is_running = true
end
def create
@game_clock = Time.now.utc
# this.setScreen(new Splash(this));
setScreen(StartupState.new(self))
end
def increment_game_clock(seconds)
@game_clock += (seconds)
end
def dispose
@is_running = false
end
end