reworked a few textures
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package zero1hd.polyjet.entity;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.assets.AssetManager;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package zero1hd.polyjet.entity.ally;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Texture;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.math.Rectangle;
|
||||
@@ -19,21 +18,21 @@ public class Laser extends Actor implements Entity, Poolable {
|
||||
|
||||
public Laser(Texture laserTexture) {
|
||||
this.laserTexture = laserTexture;
|
||||
setSize(0.25f, 1f);
|
||||
setSize(0.25f, 2f);
|
||||
}
|
||||
|
||||
public void init(float x, float y, float rate) {
|
||||
Gdx.app.debug("Laser", "Pos: " + x + "," + y);
|
||||
|
||||
setX(x);
|
||||
setY(y);
|
||||
this.rate = rate;
|
||||
hitBox = new Rectangle();
|
||||
hitBox.setSize(getWidth(), getHeight());
|
||||
toBack();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
toBack();
|
||||
moveBy(0, delta*rate);
|
||||
hitBox.setX(getX());
|
||||
hitBox.setY(getY());
|
||||
@@ -61,6 +60,9 @@ public class Laser extends Actor implements Entity, Poolable {
|
||||
|
||||
@Override
|
||||
public void collided(Entity entity) {
|
||||
if (entity.getEntityType() == Entities.VOID_CIRCLE) {
|
||||
dead = true;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package zero1hd.polyjet.entity.enemies;
|
||||
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
|
||||
@@ -24,6 +23,7 @@ public class VoidCircle extends Actor implements Entity, Poolable {
|
||||
private boolean done;
|
||||
private boolean begin;
|
||||
private Vector2 center;
|
||||
|
||||
public VoidCircle(ShapeRenderer shapeRenderer) {
|
||||
hitBox = new Rectangle();
|
||||
this.shapeRenderer = shapeRenderer;
|
||||
@@ -42,6 +42,8 @@ public VoidCircle(ShapeRenderer shapeRenderer) {
|
||||
|
||||
@Override
|
||||
public void act(float delta) {
|
||||
toFront();
|
||||
|
||||
center.x = getX()+getWidth()/2f;
|
||||
center.y = getY()+getHeight()/2f;
|
||||
hitBox.setCenter(center.x, center.y);
|
||||
|
@@ -37,6 +37,7 @@ public class GamePlayArea extends Stage {
|
||||
shapes.setProjectionMatrix(getCamera().combined);
|
||||
entityController = new EntityController(assetManager, shapes);
|
||||
collisionDetector = new CollisionDetector(entityController.activeAllies, entityController.activeEnemies);
|
||||
entityController.activeAllies.add(polyjet);
|
||||
addActor(polyjet);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user