Skip to content

Commit

Permalink
tweak the intro monster.
Browse files Browse the repository at this point in the history
  • Loading branch information
AphexHenry committed Feb 26, 2024
1 parent 22ccb18 commit fa2afd6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Tools/monsters/MonsterIntro.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ function MonsterIntro(positionCenter, width)

this.hairs = [];

for (var i = 0; i < 1800; i++) {
for (var i = 0; i < 2800; i++) {
this.hairs.push(new MonsterHair());
}
}
Expand Down Expand Up @@ -421,7 +421,7 @@ MonsterHair.prototype.update = function (aDelta) {
var lAmplitudeFromSpeed = Math.min(lSpeedAmp, lSpeedAmp * Math.sqrt(sMonster.speed.y * sMonster.speed.y + sMonster.speed.x * sMonster.speed.x) / window.innerWidth);

var lRadiusNormStart = sRayCircle * this.radius * 1.2;
var lAngle = this.angle + sGeneralTimer * 0.15;
var lAngle = this.angle + sGeneralTimer * 0.015;

this.posStart.x = lRadiusNormStart * Math.cos(lAngle);
this.posStart.y = lRadiusNormStart * Math.sin(lAngle);
Expand All @@ -442,8 +442,8 @@ MonsterHair.prototype.update = function (aDelta) {
var pointerRelX = (sPointer.x - sMonster.position.x) / sMonster.scale.x;
var pointerRelY = (sPointer.y - sMonster.position.y) / sMonster.scale.y;

pointerRelX += Math.cos(this.randomValue * 4) * 0.1;
pointerRelX += Math.cos(this.randomValue * 14) * 0.1;
// pointerRelX += Math.cos(this.randomValue * 4) * 0;
// pointerRelX += Math.cos(this.randomValue * 14) * 0;

var lAngleToPointer = Math.atan2(pointerRelY, pointerRelX);
var angleNorm = Math.atan2(this.posStart.y, this.posStart.x);
Expand All @@ -455,17 +455,17 @@ MonsterHair.prototype.update = function (aDelta) {
if (distanceToPointer < 2) {
var coeffAffectPointer = angleDistanceFromPointer / pointerAngleAmplitudeLimit;
coeffAffectPointer = Math.sqrt(coeffAffectPointer);
lPosIdleX = lPosIdleX * coeffAffectPointer + this.radius * pointerRelX * (1 - coeffAffectPointer);
lPosIdleY = lPosIdleY * coeffAffectPointer + this.radius * pointerRelY * (1 - coeffAffectPointer);
lPosIdleX = lPosIdleX * coeffAffectPointer + 1.2 * this.radius * pointerRelX * (1 - coeffAffectPointer);
lPosIdleY = lPosIdleY * coeffAffectPointer + 1.2 * this.radius * pointerRelY * (1 - coeffAffectPointer);
}
}
}

this.magnetPosition.x = (1 - deploymentStr) * this.magnetPosition.x + deploymentStr * lPosIdleX + Math.cos(lEndAngle) * excitationLevel;
this.magnetPosition.y = (1 - deploymentStr) * this.magnetPosition.y + deploymentStr * lPosIdleY + Math.cos(lEndAngle) * excitationLevel;

this.speedEnd.x = 0.3 * (this.magnetPosition.x - this.positionEnd.x) * aDelta;
this.speedEnd.y = 0.3 * (this.magnetPosition.y - this.positionEnd.y) * aDelta;
this.speedEnd.x = 0.5 * (this.magnetPosition.x - this.positionEnd.x) * aDelta;
this.speedEnd.y = 0.5 * (this.magnetPosition.y - this.positionEnd.y) * aDelta;

this.speedEnd.x *= 0.98;
this.speedEnd.y *= 0.98;
Expand Down

0 comments on commit fa2afd6

Please sign in to comment.