2 Urggr - An horizontal scrolling shoot'em up.
3 Copyright 2008 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Urggr.
7 Urggr is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Urggr is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
22 sg
= require
'fail.scenegraph'
24 Level
= fail
.utils
.class
29 -- The top level container of the rendering scene graph.
30 -- Just a group because there's nothing else currently,
31 -- and this project won't be needing anything more sophisticated
33 self
.renderablegroup
= sg
.Group()
35 self
:addGameObject( urggr
.Camera() )
36 self
:addGameObject( urggr
.PlayerShip( self
) )
40 function Level
:addGameObject( gobj
)
41 table.insert( self
.gameobjects
, gobj
)
44 function Level
:addRenderable( renderable
)
45 self
.renderablegroup
:add( renderable
)
48 function Level
:update( deltatime
)
49 for i
,v
in ipairs( self
.gameobjects
) do
54 function Level
:evaluateRender( renderpass
)
55 self
.renderablegroup
:evaluate( renderpass
)