Commit 4db3d343 authored by haiyoucuv's avatar haiyoucuv

1111

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