Bigger Barrel and bullet

This commit is contained in:
Mike Schwörer 2015-09-18 15:04:14 +02:00
parent 18d1aa4977
commit a181a786f3
7 changed files with 10 additions and 17 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

@ -20,7 +20,8 @@ public class CannonGame extends AgdxGame {
settings.debugVisualMenu.set(false);
settings.debugMenuLayerTextInfos.set(true);
settings.debugGameLayerMenuTextInfos.set(false);
settings.debugEnabled.set(true);
settings.debugEnabled.set(false);
}
@Override

View File

@ -32,7 +32,7 @@ public class CannonBarrel extends Entity {
super(Textures.cannon_barrel[0], 4, 2);
cannon = owner;
setPosition(owner.getPositionX() - 1, owner.getPositionY());
setPosition(owner.getPositionX(), owner.getPositionY());
setZLayer(ZLayers.LAYER_CANNON_BARREL);
}
@ -53,11 +53,12 @@ public class CannonBarrel extends Entity {
private void updateBullet() {
if (loaded) {
Vector2 v = new Vector2(1f - 0.2f + (120*charge)/128f, 0);
Vector2 v = new Vector2(1f - 0.5f + (1.9f) * charge, 0);
v.rotate(rotation);
bullet.setPosition(cannon.getCenterX() + v.x - bullet.getWidth()/2, cannon.getCenterY() + v.y - bullet.getHeight()/2);
bullet.scale = charge;
}
}

View File

@ -12,18 +12,17 @@ import de.samdev.cannonshooter.ZLayers;
import de.samdev.cannonshooter.teams.Team;
public class CannonBullet extends Entity {
private final static float RESIZE_SPEED = 0.005f;
private final static float RESIZE_SPEED = 0.002f;
private Cannon cannon;
private final Team team;
private boolean inBarrel = true;
private float scale = 0.001f;
public float scale = 0.001f;
private boolean death = false;
private boolean birth = true;
public CannonBullet(Cannon owner, Team t) {
super(Textures.cannon_bullet, 0.25f, 0.25f);
super(Textures.cannon_bullet, 0.5f, 0.5f);
this.cannon = owner;
this.team = t;
@ -36,14 +35,6 @@ public class CannonBullet extends Entity {
@Override
public void beforeUpdate(float delta) {
if (birth) {
scale += RESIZE_SPEED * delta;
if (scale >= 1) {
birth = false;
scale = 1;
}
}
if (death) {
scale -= RESIZE_SPEED * delta;
if (scale <= 0) {

View File

@ -17,9 +17,9 @@ void Main()
{
int idx = y*4 + x;
g.DrawImageUnscaledAndClipped(input, new Rectangle(input.Width * x, input.Height * y, input.Width - idx * 4 - 22, input.Height));
g.DrawImageUnscaledAndClipped(input, new Rectangle(input.Width * x, input.Height * y, input.Width - idx * 8 - 58, input.Height));
g.DrawImage(input, new Rectangle(input.Width * (x+1) - idx * 4 - 22, input.Height * y, 22, input.Height), new Rectangle(input.Width - 22, 0, 22, input.Height), GraphicsUnit.Pixel);
g.DrawImage(input, new Rectangle(input.Width * (x+1) - idx * 8 - 58, input.Height * y, 58, input.Height), new Rectangle(input.Width - 58, 0, 58, input.Height), GraphicsUnit.Pixel);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.