desc: Speeds up your tank temporarily.
tags: [ 'movement' ]
passives: []
- effects: [ 'speedup' ]
- # effects:
- # - include: speedup
+ # effects: [ 'speedup' ]
+ effects:
+ - include: tanks/effects/buff.Buff:speedup
cooldowns:
activate: 30.0
art:
Y.extend(exports, {
'math' : require('ezl/math'),
'loc' : require('ezl/loc'),
+ 'mixins' : require('ezl/mixins'),
'util' : require('ezl/util'),
'loop' : require('ezl/loop'),
--- /dev/null
+require('Y').Y.core
+.extend(exports, {
+ 'Speciated' : require('ezl/mixins/speciated').Speciated
+});
\ No newline at end of file
var Y = require('Y').Y
+, getNested = require('Y/types/object').getNested
, deepcopy = require('Y/types/object').deepcopy
, Mixin = require('evt').Mixin
,
+resolve =
+exports['resolve'] =
+function resolve(spec){
+ var idx = spec.indexOf('.')
+ , modName = spec.slice(0, idx !== -1 ? idx : spec.length)
+ , objName = spec.slice(idx+1)
+ , module, speciesName, symbol ;
+
+ if (idx === 0) {
+ module = window;
+ objName = spec.slice(1);
+ } else
+ module = require(modName);
+
+ idx = objName.indexOf(':');
+ if (idx !== -1) {
+ speciesName = objName.slice(idx+1);
+ objName = objName.slice(0, idx);
+ }
+
+ if (!objName)
+ this.die('Cannot resolve symbol: '+spec);
+
+ symbol = getNested(module, objName)
+ if (!symbol)
+ this.die('Unable to locate class specified by symbol (symbol="'+spec+'", module='+module+', object="'+objName+'" --> '+symbol+')!');
+
+ if (speciesName) {
+ symbol = symbol.lookup(speciesName);
+ if (!symbol) this.die('Unable to locate species specified by symbol (symbol="'+spec+'", module='+module+', object="'+objName+'", species="'+speciesName+'" --> '+symbol+')!');
+ }
+
+ return symbol;
+}
+,
+
+
Speciated =
exports['Speciated'] =
Mixin.subclass('Speciated', {
props.__species__ = id;
if (props.include) {
- var parent = this.lookup(props.inherit);
+ var parent = resolve(props.include);
props = deepcopy(Y.extend({}, parent.__species_props__, props));
delete props.include;
}
, evt = require('evt')
, getNested = require('Y/types/object').getNested
, deepcopy = require('Y/types/object').deepcopy
+, resolve = require('ezl/mixins/speciated').resolve
,
return this;
},
- resolve : function resolve(spec){
- var nameParts = spec.split('.')
- , modName = nameParts.shift()
- , module ;
-
- if (!modName)
- module = window;
- else
- module = require(modName);
-
- if (!nameParts.length)
- this.die('Cannot resolve symbol: '+spec);
-
- var symbol = getNested(module, nameParts)
- if (!symbol)
- this.die('Unable to locate class specified by symbol (symbol="'+spec+'", module='+module+' --> '+symbol+')!');
-
- return symbol;
- },
-
process : function process(data){
this.data = data;
this.fire('process', data);
this.die('No symbol defined for type "'+id+'" at '+this.path+'!');
delete props.symbol;
- var base = this.resolve(symbol);
+ var base = resolve(symbol);
if (!Y.isFunction(base.speciate))
this.die('Cannot create types from data (symbol-class '+base+' from "'+symbol+'" is not Speciated)!');
var p = cool.ratio()
, w = this.layerWidth, h = this.layerHeight
, x = w*0.5, y = h*0.5
- , amt = -HALF_PI + (1 - p)*TWO_PI;
+ , amt = p*TWO_PI - HALF_PI;
- ctx.arc(x,y, w, -HALF_PI, amt, false);
+ ctx.arc(x,y, w, -HALF_PI, amt, true);
ctx.lineTo(x,y);
ctx.lineTo(x,0);
ctx.fill();
, evt = require('evt')
, mul = Y.op.curried.mul
-, Speciated = require('tanks/mixins/speciated').Speciated
+, Speciated = require('ezl/mixins/speciated').Speciated
, Meronomic = require('tanks/mixins/meronomic').Meronomic
, Quantified = require('tanks/mixins/quantified').Quantified
,
this.bullets = new Y.YArray();
this.animations = new Y.YArray();
- // this.el = $(GAME_ELEMENT);
this.loop = new EventLoop(FRAME_RATE, this);
this.root =
new Layer({ hasCanvas:false }, { 'id':'game' })
.prependTo( $('body') );
- // this.root.shape.remove();
- // this.root.layer.attr('id', 'viewport');
this.viewport =
new Layer({ hasCanvas:false }, { 'id':'viewport' })
.appendTo( this.root );
-
this.level =
Level.create(this.levelId, this, CAPACITY, REF_SIZE)
.appendTo( this.viewport );
Thing.removeEventListener('created', this.addUnit);
Thing.removeEventListener('destroy', this.killUnit);
this.root.remove();
- // this.backpack && this.backpack.remove();
this.stop();
this.resetGlobals();
},
SQUARETH = REF_SIZE * SECONDTH;
},
- // get width(){ return this.level.width; },
- // get height(){ return this.level.height; },
-
draw : function draw(){
this.root.draw();
// this.backpack.draw();
, Item = require('tanks/thing/item').Item
, Player = require('tanks/thing/player').Player
, Wall = require('tanks/map/wall').Wall
-, Speciated = require('tanks/mixins/speciated').Speciated
+, Speciated = require('ezl/mixins/speciated').Speciated
, min = Y(Math.min).limit(2)
, max = Y(Math.max).limit(2)
require('Y').Y.core
.extend(exports, {
- 'Speciated' : require('tanks/mixins/speciated').Speciated,
'Meronomic' : require('tanks/mixins/meronomic').Meronomic,
'Quantified' : require('tanks/mixins/quantified').Quantified,
'Inventoried' : require('tanks/mixins/inventoried').Inventoried
, DensityType = constants.DensityType
, stat = require('tanks/effects/stat')
, Quantified = require('tanks/mixins/quantified').Quantified
-, Speciated = require('tanks/mixins/speciated').Speciated
+, Speciated = require('ezl/mixins/speciated').Speciated
,
this.layer.bind('click', this.onActivate);
this.inner.append(item.activateGauge);
- // item.activateGauge.draw();
return this;
},
},
onActivate : function onActivate(evt){
- console.log(this+'.onActivate()!');
+ // console.log(this+'.onActivate()!');
this.item.activate();
},
qkv = Y(window.location.search.slice(1)).fromKV();
hkv = Y(window.location.hash.slice(1)).fromKV();
+
+
// Main method is only executed once, so we'll setup things
// that don't change between games.
function main(){
function countdown(n, fn){
var el
- , showFor = 750
- , pauseFor = 500
+ , showFor = 550
+ , pauseFor = 400
, body = $('body')
, sizeRatio = 0.6