Condensed Palette, Bird AI Update
* The Red Bird now records its original altitude on the level and will try and return there should it accidentally climb up or down a wall. Sometimes goes into a wavy pattern surrounding its original altitude. * Editor UI: in the default (vertical) toolbar, the Palette now has a two column view to show more color choices on screen at once. * User setting added: hide the touch control hints.
This commit is contained in:
parent
d6e0385463
commit
d8d59fa700
|
@ -47,10 +47,17 @@ function main() {
|
||||||
}
|
}
|
||||||
sampleTick++;
|
sampleTick++;
|
||||||
|
|
||||||
|
// If we are not flying at our original altitude, correct for that.
|
||||||
|
var curV = Self.Position();
|
||||||
|
var Vy = 0.0;
|
||||||
|
if (curV.Y != altitude) {
|
||||||
|
Vy = curV.Y < altitude ? 1 : -1;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Vector() requires floats, pain in the butt for JS,
|
// TODO: Vector() requires floats, pain in the butt for JS,
|
||||||
// the JS API should be friendlier and custom...
|
// the JS API should be friendlier and custom...
|
||||||
var Vx = parseFloat(speed * (direction === "left" ? -1 : 1));
|
var Vx = parseFloat(speed * (direction === "left" ? -1 : 1));
|
||||||
Self.SetVelocity(Vector(Vx, 0.0));
|
Self.SetVelocity(Vector(Vx, Vy));
|
||||||
|
|
||||||
// If we changed directions, stop animating now so we can
|
// If we changed directions, stop animating now so we can
|
||||||
// turn around quickly without moonwalking.
|
// turn around quickly without moonwalking.
|
||||||
|
|
Loading…
Reference in New Issue
Block a user