From e83ea3fdc61efb679a1972ca2daa590daea912ea Mon Sep 17 00:00:00 2001 From: Antoine Chavasse Date: Fri, 26 Dec 2008 16:56:27 +0100 Subject: [PATCH] Some cleanup. --- src/urggr_package/camera.lua | 6 +++--- src/urggr_package/game.lua | 4 ++-- src/urggr_package/gameobject.lua | 4 ++-- src/urggr_package/level.lua | 10 +++++----- src/urggr_package/mainmenu.lua | 5 ++--- src/urggr_package/playership.lua | 6 +++--- src/urggr_package/ship.lua | 6 +++--- 7 files changed, 20 insertions(+), 21 deletions(-) diff --git a/src/urggr_package/camera.lua b/src/urggr_package/camera.lua index dd68c8e..49399a3 100644 --- a/src/urggr_package/camera.lua +++ b/src/urggr_package/camera.lua @@ -21,12 +21,12 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.Camera = fail.utils.class +Camera = fail.utils.class { - superclass = urggr.GameObject, + superclass = GameObject, function( self ) - urggr.GameObject.init( self ) + GameObject.init( self ) self.frame = nil end } diff --git a/src/urggr_package/game.lua b/src/urggr_package/game.lua index 1e0e833..7e3483e 100644 --- a/src/urggr_package/game.lua +++ b/src/urggr_package/game.lua @@ -22,7 +22,7 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.Game = fail.utils.class +Game = fail.utils.class { function( self, view ) -- Create camera @@ -61,7 +61,7 @@ urggr.Game = fail.utils.class end } -function urggr.Game:render() +function Game:render() local deltatime = self.time:elapsed() - self.lasttime self.lasttime = self.lasttime + deltatime diff --git a/src/urggr_package/gameobject.lua b/src/urggr_package/gameobject.lua index 3b7d1ee..9d4c25c 100644 --- a/src/urggr_package/gameobject.lua +++ b/src/urggr_package/gameobject.lua @@ -21,12 +21,12 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.GameObject = fail.utils.class +GameObject = fail.utils.class { function( self ) self.frame = nil end } -function urggr.GameObject:update( deltatime ) +function GameObject:update( deltatime ) end diff --git a/src/urggr_package/level.lua b/src/urggr_package/level.lua index 90d15f9..d806dd5 100644 --- a/src/urggr_package/level.lua +++ b/src/urggr_package/level.lua @@ -21,7 +21,7 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.Level = fail.utils.class +Level = fail.utils.class { function( self ) self.gameobjects = {} @@ -37,20 +37,20 @@ urggr.Level = fail.utils.class end } -function urggr.Level:addGameObject( gobj ) +function Level:addGameObject( gobj ) table.insert( self.gameobjects, gobj ) end -function urggr.Level:addRenderable( renderable ) +function Level:addRenderable( renderable ) self.renderablegroup:add( renderable ) end -function urggr.Level:update( deltatime ) +function Level:update( deltatime ) for i,v in ipairs( self.gameobjects ) do v:update( deltatime ) end end -function urggr.Level:evaluateRender( renderpass ) +function Level:evaluateRender( renderpass ) self.renderablegroup:evaluate( renderpass ) end diff --git a/src/urggr_package/mainmenu.lua b/src/urggr_package/mainmenu.lua index a573db7..3876015 100644 --- a/src/urggr_package/mainmenu.lua +++ b/src/urggr_package/mainmenu.lua @@ -22,7 +22,7 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.MainMenu = fail.utils.class +MainMenu = fail.utils.class { function( self, view ) -- Create camera @@ -62,7 +62,7 @@ urggr.MainMenu = fail.utils.class end } -function urggr.MainMenu:render() +function MainMenu:render() local deltatime = self.time:elapsed() - self.lasttime self.lasttime = self.lasttime + deltatime @@ -75,4 +75,3 @@ function urggr.MainMenu:render() QTimer.singleShot( 10, self.qtscene, "1update()" ) end - diff --git a/src/urggr_package/playership.lua b/src/urggr_package/playership.lua index 0b72407..3cd366c 100644 --- a/src/urggr_package/playership.lua +++ b/src/urggr_package/playership.lua @@ -22,12 +22,12 @@ require 'fail.math' sg = require 'fail.scenegraph' require 'fail.scenegraph.shapes' -urggr.PlayerShip = fail.utils.class +PlayerShip = fail.utils.class { - superclass = urggr.Ship, + superclass = Ship, function( self, level ) - urggr.Ship.init( self ) + Ship.init( self ) self.frame = sg.Frame() diff --git a/src/urggr_package/ship.lua b/src/urggr_package/ship.lua index b6f11c3..ead08c2 100644 --- a/src/urggr_package/ship.lua +++ b/src/urggr_package/ship.lua @@ -21,12 +21,12 @@ require 'fail.utils' require 'fail.math' sg = require 'fail.scenegraph' -urggr.Ship = fail.utils.class +Ship = fail.utils.class { - superclass = urggr.GameObject, + superclass = GameObject, function( self ) - urggr.GameObject.init( self ) + GameObject.init( self ) self.frame = nil end } -- 2.11.4.GIT