HTML and CSS Reference
In-Depth Information
color: 'red',
r: 8,
restitution: 0.5,
density: 4,
x: props.dx * 50 + 10,
y: props.dy * 50 + 210,
seconds: 5
});
this.add('physics');
this.bind('step',this,'countdown');
},
countdown: function(dt) {
this.p.seconds -= dt;
if(this.p.seconds < 0) {
this.destroy();
} else if(this.p.seconds < 1) {
this.set({ "fill-opacity": this.p.seconds });
}
}
});
Q.Cannon = Q.Sprite.extend({
init: function(props) {
this._super({
shape:'polygon',
color: 'black',
points: [[ 0,0 ], [0,-5], [5,-10], [8, -11], [40, -11],
[ 40, 11], [8, 11], [5, 10], [0, 5] ],
x: 10,
y: 210
});
},
fire: function() {
var dx = Math.cos(this.p.angle / 180 * Math.PI),
dy = Math.sin(this.p.angle / 180 * Math.PI),
ball = new Q.CannonBall({ dx: dx, dy: dy, angle: this.p.angle
});
Q.stage().insert(ball);
ball.physics.velocity(dx*400,dy*400);
}
});
var targetCount = 0;
Q.Target = Q.Sprite.extend({
Search WWH ::




Custom Search