Hacky projectile system
This commit is contained in:
71
js/tiles.js
71
js/tiles.js
@@ -55,74 +55,5 @@ export const TOWER_FIREBALL1 = new LayeredTileFactory([
|
||||
tower_fireball1,
|
||||
tower_fireball1_front,
|
||||
]);
|
||||
/*
|
||||
class Fireball extends SimpleTileFactory {
|
||||
get_elem(tileset: string): HTMLElement {
|
||||
const elem = document.createElement('div');
|
||||
elem.style.gridColumnEnd = `span ${this.width}`;
|
||||
elem.style.gridRowEnd = `span ${this.height}`;
|
||||
elem.style.position = 'relative';
|
||||
|
||||
const base = document.createElement('div');
|
||||
elem.appendChild(base);
|
||||
base.style.width = '100%';
|
||||
base.style.height = '100%';
|
||||
base.style.position = 'absolute';
|
||||
base.style.top = '0';
|
||||
base.style.left = '0';
|
||||
base.style.backgroundImage = `url("images/${tileset}/${this.name}.svg")`;
|
||||
base.style.backgroundSize = 'cover';
|
||||
base.style.visibility = 'hidden';
|
||||
|
||||
setInterval(() => {
|
||||
base.animate([
|
||||
{
|
||||
'offset': 0.0,
|
||||
'easing': 'cubic-bezier(0.33, 0.66, 0.66, 1.00)',
|
||||
|
||||
'top': '0',
|
||||
},
|
||||
{
|
||||
'offset': 0.50,
|
||||
'easing': 'cubic-bezier(0.33, 0.00, 0.66, 0.33)',
|
||||
|
||||
'top': '-500%',
|
||||
},
|
||||
{
|
||||
'offset': 1.0,
|
||||
|
||||
'top': '0',
|
||||
},
|
||||
], {
|
||||
'duration': 1500,
|
||||
'iterations': 1,
|
||||
});
|
||||
|
||||
base.animate([
|
||||
{
|
||||
'offset': 0.0,
|
||||
'easing': 'linear',
|
||||
|
||||
'visibility': 'visible',
|
||||
'left': '0',
|
||||
'transform': 'rotate(0)',
|
||||
},
|
||||
{
|
||||
'offset': 1.0,
|
||||
|
||||
'visibility': 'hidden',
|
||||
'left': '1000%',
|
||||
'transform': 'rotate(720deg)',
|
||||
},
|
||||
], {
|
||||
'duration': 1500,
|
||||
'iterations': 1,
|
||||
});
|
||||
}, 3250);
|
||||
|
||||
return elem;
|
||||
}
|
||||
}
|
||||
export const FIREBALL = new Fireball('fireball', 2, 2);
|
||||
*/
|
||||
export const FIREBALL = new SimpleTileFactory('projectile', 2, 2, 'fireball');
|
||||
//# sourceMappingURL=tiles.js.map
|
||||
Reference in New Issue
Block a user