add ship rendering and damping

This commit is contained in:
Asraelite 2016-03-22 13:18:43 +00:00
parent 05ad81ed8d
commit 80bd84230d
22 changed files with 66 additions and 6 deletions

View file

@ -0,0 +1,35 @@
function loadAssets() {
var sources = {
images: {
ships: {
'01': {
hull: 'img/ships/01/hull.png',
teama: 'img/ships/01/teama.png',
teamb: 'img/ships/01/teamb.png',
thrust0: 'img/ships/01/thrust0.png',
thrust5: 'img/ships/01/thrust5.png',
thrust8: 'img/ships/01/thrust8.png'
}
}
}
}
var result = {};
// Magical recursive magic.
(function r(o, t) {
for (var i in o) {
console.log(i);
if (typeof o[i] == 'string') {
t[i] = new Image();
t[i].src = o[i];
} else {
t[i] = {};
r(o[i], t[i]);
}
}
t = o;
})(sources, result);
return result;
}