Commit 4db3d343 authored by haiyoucuv's avatar haiyoucuv

1111

parent a7b8c4c0
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="zh">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
......
...@@ -110,6 +110,7 @@ ...@@ -110,6 +110,7 @@
}; };
return Moist; return Moist;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=Moist.js.map
var TimeCounter = (function (_super) { var TimeCounter = (function (_super) {
tslib.__extends(TimeCounter, _super); tslib.__extends(TimeCounter, _super);
...@@ -254,6 +255,9 @@ ...@@ -254,6 +255,9 @@
point3.y = 100; point3.y = 100;
point3.endFill(); point3.endFill();
this.rightHand.addChild(point3); this.rightHand.addChild(point3);
window['p1'] = point1;
window['p2'] = point2;
window['p3'] = point3;
this.timeCounter = new TimeCounter(); this.timeCounter = new TimeCounter();
this.addChild(this.timeCounter); this.addChild(this.timeCounter);
var ld = Date.now(); var ld = Date.now();
...@@ -298,17 +302,15 @@ ...@@ -298,17 +302,15 @@
this.addEventListener(engine.Event.ENTER_FRAME, function addFrame() { this.addEventListener(engine.Event.ENTER_FRAME, function addFrame() {
var _this = this; var _this = this;
var dt = Date.now() - ld; var dt = Date.now() - ld;
a += dt;
b += dt; b += dt;
timer += dt; timer += dt;
if (timer >= 3000) { if (timer >= 3000) {
if (a > 200) { a += dt;
if (a > 10) {
a = 0; a = 0;
if (this.moists.percent < 1 && this.timeCounter.time > 0) { if (this.moists.percent < 1 && this.timeCounter.time > 0) {
var drip = new engine.Sprite(getTexture("07f74bf6-416f-445e-98d5-021efe4c9fdc")); var drip = new engine.Sprite(getTexture("07f74bf6-416f-445e-98d5-021efe4c9fdc"));
drip.x = drip.x = Math.random() * (this.humanbeing.x + 160) + (this.humanbeing.x - 160);
Math.random() * (this.humanbeing.x + 160) +
(this.humanbeing.x - 160);
drip.y = Math.random() * 100 + 300; drip.y = Math.random() * 100 + 300;
this.dripArray.push(drip); this.dripArray.push(drip);
this.addChild(drip); this.addChild(drip);
...@@ -361,34 +363,39 @@ ...@@ -361,34 +363,39 @@
} }
this.angle = Math.asin(this.D / 2 / this.R) * 57.18; this.angle = Math.asin(this.D / 2 / this.R) * 57.18;
this.rightHand.name = "aaa"; this.rightHand.name = "aaa";
if (this.stage.height > 1334) ; var sa = this.worldMatrix.a;
var k12 = (point1.worldMatrix.ty - point2.worldMatrix.ty) / var sd = this.worldMatrix.d;
(point1.worldMatrix.tx - point2.worldMatrix.tx); var p1x = point1.worldMatrix.tx / sa;
var k23 = (point2.worldMatrix.ty - point3.worldMatrix.ty) / var p2x = point2.worldMatrix.tx / sa;
(point2.worldMatrix.tx - point3.worldMatrix.tx); var p3x = point3.worldMatrix.tx / sa;
var px1 = point1.worldMatrix.tx; var p1y = point1.worldMatrix.ty / sd;
var px2 = point2.worldMatrix.tx; var p2y = point2.worldMatrix.ty / sd;
var px3 = point3.worldMatrix.tx; var p3y = point3.worldMatrix.ty / sd;
var k12 = (p1y - p2y) / (p1x - p2x);
var k23 = (p2y - p3y) / (p2x - p3x);
var px1 = p1x;
var px2 = p2x;
var px3 = p3x;
var maxX = px1 >= px2 ? (px1 >= px3 ? px1 : px3) : px2 >= px3 ? px2 : px3; var maxX = px1 >= px2 ? (px1 >= px3 ? px1 : px3) : px2 >= px3 ? px2 : px3;
var minX = px1 >= px2 ? (px2 >= px3 ? px3 : px2) : px1 >= px3 ? px3 : px1; var minX = px1 >= px2 ? (px2 >= px3 ? px3 : px2) : px1 >= px3 ? px3 : px1;
var x2 = (middleX + this.R) < maxX ? (middleX + this.R) : maxX; var x2 = (middleX + this.R) < maxX ? (middleX + this.R) : maxX;
var _loop_2 = function (drip) { var _loop_2 = function (drip) {
var b12 = point1.worldMatrix.ty - var dx = drip.worldMatrix.tx / sa;
point1.worldMatrix.tx * k12 - 50; var dy = drip.worldMatrix.ty / sd;
var b23 = point2.worldMatrix.ty - var b12 = p1y - p1x * k12 - 50;
point2.worldMatrix.tx * k23 - 50; var b23 = p2y - p2x * k23 - 50;
var y12 = k12 * drip.x + b12; var y12 = k12 * dx + b12;
var y23 = k23 * drip.x + b23; var y23 = k23 * dx + b23;
if (drip.x >= minX && drip.x < maxX) { if (dx >= minX && dx < maxX) {
if (drip.x < px2) { if (dx < px2) {
if (drip.y >= y12) { if (dy >= y12) {
var index_2 = this_2.dripArray.indexOf(drip); var index_2 = this_2.dripArray.indexOf(drip);
this_2.removeChild(drip); this_2.removeChild(drip);
this_2.dripArray = this_2.dripArray.filter(function (ele, i) { return i != index_2; }); this_2.dripArray = this_2.dripArray.filter(function (ele, i) { return i != index_2; });
} }
} }
if (drip.x >= px2) { if (dx >= px2) {
if (drip.y >= y23) { if (dy >= y23) {
var index_3 = this_2.dripArray.indexOf(drip); var index_3 = this_2.dripArray.indexOf(drip);
this_2.removeChild(drip); this_2.removeChild(drip);
this_2.dripArray = this_2.dripArray.filter(function (ele, i) { return i != index_3; }); this_2.dripArray = this_2.dripArray.filter(function (ele, i) { return i != index_3; });
...@@ -456,7 +463,6 @@ ...@@ -456,7 +463,6 @@
}; };
return GameTest; return GameTest;
}(engine.Container)); }(engine.Container));
//# sourceMappingURL=GameTest.js.map
var props = {}; var props = {};
function prepareProps() { function prepareProps() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment