mirror of
https://github.com/logsol/chuck.js.git
synced 2026-05-11 10:37:34 +00:00
missing commits from last commit 7eb3d0b8b0
This commit is contained in:
parent
7eb3d0b8b0
commit
039213cf50
11 changed files with 257 additions and 430 deletions
|
|
@ -53,14 +53,16 @@ function (Parent, Item, Box2D, Nc) {
|
|||
|
||||
if(absItemVelocity.x > max || absItemVelocity.y > max) {
|
||||
if(item.lastMoved && item.lastMoved.player != this.player) {
|
||||
var damage = b2Math.SubtractVV(itemVelocity, ownVelocity);
|
||||
damage.Abs();
|
||||
damage.Multiply(itemMass);
|
||||
var damageVector = b2Math.SubtractVV(itemVelocity, ownVelocity);
|
||||
damageVector.Abs();
|
||||
damageVector.Multiply(itemMass);
|
||||
var damage = damageVector.Length() * 2;
|
||||
damage *= item.options.danger ? item.options.danger : 1;
|
||||
|
||||
var player = item.lastMoved.player;
|
||||
|
||||
var callback = function() {
|
||||
self.player.addDamage(damage.Length() * 2, player);
|
||||
self.player.addDamage(damage, player);
|
||||
}
|
||||
|
||||
Nc.trigger(Nc.ns.channel.engine.worldQueue.add, callback)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue