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'
23 require
'fail.scenegraph.shapes'
25 PlayerShip
= fail
.utils
.class
29 function( self
, level
)
32 self
.frame
= sg
.Frame()
34 -- Create a renderable for the player ship. For now we just conjure a procedural cone
35 -- programmaticaly, at some point it'll be a renderable loaded from disk.
36 local mat
= sg
.Material()
37 mat
.Emission
.value
= fail
.math
.Vector4f( 1, 0, 0, 1 )
38 mat
.Specular
.value
= fail
.math
.Vector4f( 0, 0, 0, 1 )
39 self
.renderable
= sg
.shapes
.Cone( mat
, self
.frame
)
41 level
:addRenderable( self
.renderable
)