Skip to content

Commit

Permalink
Migrated to sprites
Browse files Browse the repository at this point in the history
  • Loading branch information
neauoire committed Feb 28, 2017
1 parent b19403a commit c7fc643
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -0,0 +1,2 @@
node_modules/
builds/
2 changes: 1 addition & 1 deletion links/main.css
Expand Up @@ -27,7 +27,7 @@ stage parallax.under { background-image:url(../media/graphics/effects/parallax.2
.black stage parallax.under { background-image:url(../media/graphics/effects/parallax.4.png); }
.pillars stage parallax.over { background-image:url(../media/graphics/effects/parallax.6.png); }
.pillars stage parallax.under { background-image:url(../media/graphics/effects/parallax.7.png); }
tile,notification { background-size:contain; background-position:center center; background-repeat:no-repeat; position:absolute; width:20%; height:40%; margin-left:-10%;}
tile,notification { background-size:100%; background-position:0px center; background-repeat:repeat-x; position:absolute; width:20%; height:40%; margin-left:-10%;}
tile.floor { margin-top:-20%; }
tile.wall {margin-top:-30%; }
tile.wall.left { -webkit-transform: scaleX(-1); transform: scaleX(-1);}
Expand Down
Binary file removed media/graphics/pillarbase/base.idle.2.png
Binary file not shown.
Binary file removed media/graphics/pillarbase/base.idle.3.png
Binary file not shown.
File renamed without changes
16 changes: 15 additions & 1 deletion scripts/core/animator.js
Expand Up @@ -16,7 +16,21 @@ function Animator(host)
if(!this.animations[this.state]){ return; }

var anim = this.animations[this.state];
var width = $(this.host.element).width();
var height = $(this.host.element).height();
var frames = unique(this.animations[this.state].frames).length;

$(this.host.element).css('background-image', "url(media/graphics/"+this.host.name+"/"+(this.host.id ? this.host.id+"." : "")+this.state+"."+anim.run()+".png)");
$(this.host.element).css('background-image', "url(media/graphics/"+this.host.name+"/"+(this.host.id ? this.host.id+"." : "")+this.state+".png)");
$(this.host.element).css('background-size',(width*frames)+"px "+(width*1.5)+"px");
$(this.host.element).css('background-position',(anim.run() * -width + width)+"px center");
}
}

function unique(list)
{
var result = [];
$.each(list, function(i, e) {
if ($.inArray(e, result) == -1) result.push(e);
});
return result;
}
35 changes: 29 additions & 6 deletions scripts/core/game.js
Expand Up @@ -15,9 +15,20 @@ function Game()

localStorage.character = oquonie.player.id;
localStorage.room = oquonie.stage.room.id;
localStorage.ramens = oquonie.spellbook.ramens;
localStorage.pillars = oquonie.spellbook.pillars;
localStorage.spells = oquonie.spellbook.spells;

localStorage.ramen_necomedre = oquonie.spellbook.has_ramen("necomedre");
localStorage.ramen_nephtaline = oquonie.spellbook.has_ramen("nephtaline");
localStorage.ramen_neomine = oquonie.spellbook.has_ramen("neomine");
localStorage.ramen_nestorine = oquonie.spellbook.has_ramen("nestorine");
localStorage.ramen_nemedique = oquonie.spellbook.has_ramen("nemedique");
localStorage.ramen_nastazie = oquonie.spellbook.has_ramen("nastazie");

localStorage.pillar_necomedre = oquonie.spellbook.has_pillar("necomedre");
localStorage.pillar_nephtaline = oquonie.spellbook.has_pillar("nephtaline");
localStorage.pillar_neomine = oquonie.spellbook.has_pillar("neomine");
localStorage.pillar_nestorine = oquonie.spellbook.has_pillar("nestorine");
localStorage.pillar_nemedique = oquonie.spellbook.has_pillar("nemedique");
localStorage.pillar_nastazie = oquonie.spellbook.has_pillar("nastazie");

return h;
}
Expand All @@ -28,9 +39,21 @@ function Game()

oquonie.player.id = localStorage.character;
oquonie.player.location = localStorage.room;
oquonie.spellbook.ramens = localStorage.ramens;
oquonie.spellbook.pillars = localStorage.pillars;
oquonie.spellbook.spells = localStorage.spells;

if(localStorage.ramen_necomedre){ oquonie.spellbook.add_ramen("necomedre")}
if(localStorage.ramen_nephtaline){ oquonie.spellbook.add_ramen("nephtaline")}
if(localStorage.ramen_neomine){ oquonie.spellbook.add_ramen("neomine")}
if(localStorage.ramen_nestorine){ oquonie.spellbook.add_ramen("nestorine")}
if(localStorage.ramen_nemedique){ oquonie.spellbook.add_ramen("nemedique")}
if(localStorage.ramen_nastazie){ oquonie.spellbook.add_ramen("nastazie")}

if(localStorage.pillar_necomedre){ oquonie.spellbook.has_pillar("necomedre")}
if(localStorage.pillar_nephtaline){ oquonie.spellbook.has_pillar("nephtaline")}
if(localStorage.pillar_neomine){ oquonie.spellbook.has_pillar("neomine")}
if(localStorage.pillar_nestorine){ oquonie.spellbook.has_pillar("nestorine")}
if(localStorage.pillar_nemedique){ oquonie.spellbook.has_pillar("nemedique")}
if(localStorage.pillar_nastazie){ oquonie.spellbook.has_pillar("nastazie")}

}

this.is_found = function()
Expand Down

0 comments on commit c7fc643

Please sign in to comment.