mirror of
https://github.com/Noratrieb/Java2DGame.git
synced 2026-01-14 14:05:01 +01:00
shooting works
This commit is contained in:
parent
0d5397dbe3
commit
e2483b30ff
8 changed files with 45 additions and 23 deletions
|
|
@ -92,9 +92,7 @@ public class Turret extends GameObject {
|
|||
lastShot = System.currentTimeMillis();
|
||||
|
||||
Vector2D shellVel = new Vector2D(xCenterAbs - msLoc.x, yCenterAbs - msLoc.y).normalized().negative().multiply(SHELL_SPEED);
|
||||
Vector2D pos = Vector2D.rotateAround(new Vector2D(xCenterAbs, yCenterAbs), new Vector2D(barrelX, frontPosY), rotation, Vector2D.CLOCKWISE);
|
||||
|
||||
master.debugPos(pos);
|
||||
Vector2D pos = Vector2D.rotateAround(new Vector2D(xCenterAbs, yCenterAbs), new Vector2D(barrelX, frontPosY), rotation, Vector2D.COUNTERCLOCKWISE);
|
||||
|
||||
master.create(new Shell(pos, new Vector2D(10, 10), shellVel));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue