snake
This commit is contained in:
parent
a76610e21e
commit
50b6bfbe1a
@ -165,17 +165,17 @@ public class SnakeCreature extends EventCreature<Silverfish>
|
|||||||
{
|
{
|
||||||
Vector moveTo = UtilAlg.getTrajectory(vec, _waypoint.toVector());
|
Vector moveTo = UtilAlg.getTrajectory(vec, _waypoint.toVector());
|
||||||
|
|
||||||
Vector target = vec.clone().add(moveTo.multiply(1));
|
// Vector target = vec.clone().add(moveTo.multiply(3));
|
||||||
|
//
|
||||||
|
// //MATHS
|
||||||
|
// double speed = 10d;
|
||||||
|
// double right = -Math.sin(_ticks/speed) * 4;
|
||||||
|
// double up = Math.cos(_ticks/speed) * 4;
|
||||||
|
//
|
||||||
|
// target.add(UtilAlg.getRight(vec).multiply(right));
|
||||||
|
// target.add(UtilAlg.getUp(vec).multiply(up));
|
||||||
|
|
||||||
//MATHS
|
_velocity.add(moveTo.normalize().multiply(0.04));
|
||||||
double speed = 10d;
|
|
||||||
double right = -Math.sin(_ticks/speed) * 4;
|
|
||||||
double up = Math.cos(_ticks/speed) * 4;
|
|
||||||
|
|
||||||
target.add(UtilAlg.getRight(vec).multiply(right));
|
|
||||||
target.add(UtilAlg.getUp(vec).multiply(up));
|
|
||||||
|
|
||||||
_velocity.add(target.normalize().multiply(0.04));
|
|
||||||
|
|
||||||
if (_velocity.length() > 0.5)
|
if (_velocity.length() > 0.5)
|
||||||
_velocity.normalize().multiply(0.5);
|
_velocity.normalize().multiply(0.5);
|
||||||
|
Loading…
Reference in New Issue
Block a user