projects
/
featherfall2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow empty attribute syntax to mean "same command as ID".
[featherfall2.git]
/
src
/
main.js
diff --git
a/src/main.js
b/src/main.js
index
1846c3e
..
6c1505d
100644
(file)
--- a/
src/main.js
+++ b/
src/main.js
@@
-113,7
+113,7
@@
var PlayerController = yT(yuu.C, {
tick: function () {
this._updatePivots();
tick: function () {
this._updatePivots();
- var THRUST = 5;
+ var THRUST =
3.
5;
/* var DRAG_FREE = 0.01;
var DRAG_OPEN = 0.5;
var DRAG_LOCK = 1;
/* var DRAG_FREE = 0.01;
var DRAG_OPEN = 0.5;
var DRAG_LOCK = 1;
@@
-129,14
+129,6
@@
var PlayerController = yT(yuu.C, {
this.body.body.ApplyForceToCenter(leftThrust);
this.body.body.ApplyForceToCenter(rightThrust);
this.body.body.ApplyForceToCenter(leftThrust);
this.body.body.ApplyForceToCenter(rightThrust);
- var cleft = Math.cos(leftAngle);
- var cright = Math.cos(rightAngle);
- var sleft = Math.sin(leftAngle);
- var sright = Math.sin(rightAngle);
-
- var ax = thrust * (cleft - cright);
- var ay = thrust * (sright + sleft);
-
/*
var v = this.body.linearVelocity;
var drag = this.up ? DRAG_OPEN : this.free ? DRAG_FREE : DRAG_LOCK;
/*
var v = this.body.linearVelocity;
var drag = this.up ? DRAG_OPEN : this.free ? DRAG_FREE : DRAG_LOCK;
@@
-147,8
+139,6
@@
var PlayerController = yT(yuu.C, {
ax += CORRECTION * (cleft - cright) * v.y * v.y * Math.sign(v.y);
*/
ax += CORRECTION * (cleft - cright) * v.y * v.y * Math.sign(v.y);
*/
- this.body.ApplyForce(new b2Vec2(ax, ay), this.body.position);
-
this._updateTransforms();
},
this._updateTransforms();
},
@@
-185,7
+175,6
@@
function pinJoint (world, bodyA, bodyB, anchor) {
dfn.maxMotorTorque = 100.0;
dfn.motorSpeed = 0.1;
dfn.enableMotor = true;
dfn.maxMotorTorque = 100.0;
dfn.motorSpeed = 0.1;
dfn.enableMotor = true;
- dfn.enableLimit = true;
return Box2D.castObject(world.CreateJoint(dfn), Box2D.b2RevoluteJoint);
}
return Box2D.castObject(world.CreateJoint(dfn), Box2D.b2RevoluteJoint);
}
@@
-224,8
+213,6
@@
var GameScene = yT(yuu.Scene, {
var rightJoint = pinJoint(world, right.body, body.body, [0.1, 5.15]);
this.player.addChildren(leftWing, rightWing);
this.entity0.addChild(this.player);
var rightJoint = pinJoint(world, right.body, body.body, [0.1, 5.15]);
this.player.addChildren(leftWing, rightWing);
this.entity0.addChild(this.player);
- leftJoint.SetLimits(0, Math.PI / 2);
- rightJoint.SetLimits(-Math.PI / 2, 0);
var ground = new yuu.E(
new BodyC(bodyFromLine(world, [-100, 0], [100, 0])),
var ground = new yuu.E(
new BodyC(bodyFromLine(world, [-100, 0], [100, 0])),