aaaaaaAAAAAAAAAAAa
@ -2,6 +2,7 @@ package io.anuke.mindustry.entities;
|
|||||||
|
|
||||||
import io.anuke.arc.math.*;
|
import io.anuke.arc.math.*;
|
||||||
import io.anuke.arc.math.geom.*;
|
import io.anuke.arc.math.geom.*;
|
||||||
|
import io.anuke.arc.util.*;
|
||||||
import io.anuke.mindustry.entities.traits.*;
|
import io.anuke.mindustry.entities.traits.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,8 +24,8 @@ public class Predict{
|
|||||||
* @return the intercept location
|
* @return the intercept location
|
||||||
*/
|
*/
|
||||||
public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){
|
public static Vector2 intercept(float srcx, float srcy, float dstx, float dsty, float dstvx, float dstvy, float v){
|
||||||
//dstvx /= Time.delta();
|
dstvx /= Time.delta();
|
||||||
//dstvy /= Time.delta();
|
dstvy /= Time.delta();
|
||||||
float tx = dstx - srcx,
|
float tx = dstx - srcx,
|
||||||
ty = dsty - srcy;
|
ty = dsty - srcy;
|
||||||
|
|
||||||
@ -54,9 +55,7 @@ public class Predict{
|
|||||||
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
* See {@link #intercept(float, float, float, float, float, float, float)}.
|
||||||
*/
|
*/
|
||||||
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
|
public static Vector2 intercept(TargetTrait src, TargetTrait dst, float v){
|
||||||
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(),
|
return intercept(src.getX(), src.getY(), dst.getX(), dst.getY(), dst.getTargetVelocityX() - src.getTargetVelocityX(), dst.getTargetVelocityY() - src.getTargetVelocityY(), v);
|
||||||
dst.getTargetVelocityX() - src.getTargetVelocityX()/2f,
|
|
||||||
dst.getTargetVelocityY() - src.getTargetVelocityY()/2f, v);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Vector2 quad(float a, float b, float c){
|
private static Vector2 quad(float a, float b, float c){
|
||||||
|
@ -750,8 +750,7 @@ public class Player extends Unit implements BuilderMinerTrait, ShooterTrait{
|
|||||||
rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f);
|
rotation = Mathf.slerpDelta(rotation, angleTo(target), 0.2f);
|
||||||
}
|
}
|
||||||
|
|
||||||
Vector2 intercept =
|
Vector2 intercept = Predict.intercept(this, target, getWeapon().bullet.speed);
|
||||||
Predict.intercept(x, y, target.getX(), target.getY(), target.velocity().x - velocity.x, target.velocity().y - velocity.y, getWeapon().bullet.speed);
|
|
||||||
|
|
||||||
pointerX = intercept.x;
|
pointerX = intercept.x;
|
||||||
pointerY = intercept.y;
|
pointerY = intercept.y;
|
||||||
|
Before Width: | Height: | Size: 622 KiB After Width: | Height: | Size: 996 KiB |
Before Width: | Height: | Size: 783 KiB After Width: | Height: | Size: 1.3 MiB |
Before Width: | Height: | Size: 1.8 MiB After Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 2.2 MiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 2.8 MiB |
Before Width: | Height: | Size: 701 KiB After Width: | Height: | Size: 993 KiB |
Before Width: | Height: | Size: 1.7 MiB After Width: | Height: | Size: 3.1 MiB |
Before Width: | Height: | Size: 662 KiB After Width: | Height: | Size: 1.1 MiB |
Before Width: | Height: | Size: 576 KiB After Width: | Height: | Size: 890 KiB |
Before Width: | Height: | Size: 215 KiB After Width: | Height: | Size: 278 KiB |