diff --git a/guiltouf/css/style.css b/guiltouf/css/style.css index 7720f89..cff6a7c 100644 --- a/guiltouf/css/style.css +++ b/guiltouf/css/style.css @@ -18,19 +18,14 @@ z-index: 0; } -#ground { - z-index: 30; -} - -#game { - z-index: 60; -} +#ground { z-index: 30; } +#game { z-index: 60; } /* The Ship */ #game #ship { position: absolute; - display: block; + display: none; top:0; left:0; background: transparent; @@ -67,6 +62,21 @@ background: transparent url(/images/sprites/weapon_pilot.png) no-repeat 0 0; } +#ship .ship-foray { + position: absolute; + display: block; + top:30px; + left: 117px; + width: 19px; + height: 33px; + background: transparent url(/images/sprites/weapon_foray.png) no-repeat 0 0; +} + +#ship .ship-foray.right { + background-position: right 0; + left: 24px; +} + #ship .ship-reactor { position: absolute; display: block; @@ -88,17 +98,15 @@ } /* Ennemies */ -#game .ennemy { border: 1px solid blue; } +/*#game .ennemy { border: 1px solid blue; } */ + + +/* The HUD */ #hud { z-index: 90; display: none; } -#ship { - top: 50%; - left: 50%; - background: white; -} /* Debug Panel */ #debug { diff --git a/guiltouf/images/sprites/weapon_foray.png b/guiltouf/images/sprites/weapon_foray.png index 689569f..61649c5 100644 Binary files a/guiltouf/images/sprites/weapon_foray.png and b/guiltouf/images/sprites/weapon_foray.png differ diff --git a/guiltouf/index.html b/guiltouf/index.html index 8e7645a..07124fb 100644 --- a/guiltouf/index.html +++ b/guiltouf/index.html @@ -15,6 +15,8 @@
+
+
diff --git a/guiltouf/js/GameClass.js b/guiltouf/js/GameClass.js index 02e6954..7189e58 100644 --- a/guiltouf/js/GameClass.js +++ b/guiltouf/js/GameClass.js @@ -1,5 +1,5 @@ // Init Global vars -var FPS = 30; +var FPS = 40; var Stages = {} ; var Level = 1 ; var Layouts = {} ; @@ -77,6 +77,9 @@ app.prototype.loopAnimation = function() { // -- Build an active elements list this.activeEls = [] ; + // -- Detect collisions + + // -- Search for elements that have to be updated for ( var i in Layouts ) { var _layout = Layouts[i] ; @@ -91,10 +94,10 @@ app.prototype.loopAnimation = function() { var _el = Layouts.Ennemies.els[i] ; if ( ! _el.deleteAfter ) numEnnemies++ ; } - $('#debug').html(numEnnemies) ; for ( var i = numEnnemies-1 ; i < Level + 3 ; i++ ) { Layouts.Ennemies.createRandom() ; } + } // -- Bind Inputs diff --git a/guiltouf/js/LayoutClass.js b/guiltouf/js/LayoutClass.js index af9bcf8..c94389c 100644 --- a/guiltouf/js/LayoutClass.js +++ b/guiltouf/js/LayoutClass.js @@ -132,6 +132,8 @@ Layout.prototype.createObj = function(opts) { backgroundImage: settingsObj.imageSrc ? 'url('+settingsObj.imageSrc+')' : '' } }).appendTo(self.dom) ; + } else { + this.box.show(0) ; } // -- Apply CSS diff --git a/guiltouf/js/layouts/PlayerLayer.js b/guiltouf/js/layouts/PlayerLayer.js index a7a1bb3..50c3f12 100644 --- a/guiltouf/js/layouts/PlayerLayer.js +++ b/guiltouf/js/layouts/PlayerLayer.js @@ -18,7 +18,6 @@ Layouts.Player = new Layout({ // -- KEY up /down if ( Wyrian.input.keyboard.up ) { if ( obj.y > 0 ) obj.y -= obj.parent.settings.speed ; - } if ( Wyrian.input.keyboard.down && (obj.y < (Wyrian.height-obj.height) ) ) { obj.y += obj.parent.settings.speed; @@ -94,7 +93,7 @@ Layouts.Player.bulletLib = function(obj, bulletType) { bulletConf.height = 60 ; bulletConf.speed = 20 ; bulletConf.name = 'bullet' ; - bulletConf.origin.x = obj.x+20+obj.width/2 ; + bulletConf.origin.x = obj.x+18+obj.width/2 ; bulletConf.origin.y = obj.y + 50 - bulletConf.height ; }