Skip to content
This repository has been archived by the owner on Oct 13, 2018. It is now read-only.

Commit

Permalink
Bullet konstruktor egyszerűsítése
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfmanfp committed Jun 11, 2018
1 parent ca4bfae commit 29c6448
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions core/src/hu/wolfman/deimos/entities/Bullet.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import hu.wolfman.deimos.physics.BodyBuilder;
import hu.wolfman.deimos.physics.FixtureBuilder;
import hu.wolfman.deimos.utils.Resources;

import static hu.wolfman.deimos.Constants.*;

Expand All @@ -23,15 +24,13 @@ public class Bullet extends Entity {
* A töltény konstruktora.
*
* @param world Box2D világ
* @param baseTexture A töltény textúrája
* @param x X koordináta
* @param y Y koordináta
* @param isFlyingRight Meghatározza, hogy milyen irányba repül
* @param owner A tulajdonos objektum
*/
public Bullet(World world, TextureRegion baseTexture,
float x, float y, boolean isFlyingRight, Object owner) {
super(world, baseTexture);
public Bullet(World world, float x, float y, boolean isFlyingRight, Object owner) {
super(world, new TextureRegion(Resources.get().texture("bullet")));
this.owner = owner;
this.isEnemy = owner instanceof Enemy;

Expand Down
1 change: 0 additions & 1 deletion core/src/hu/wolfman/deimos/entities/Enemy.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ public void fire() {
Resources.get().sound("shoot").play();
bullets.add(new Bullet(
world,
new TextureRegion(Resources.get().texture("bullet")),
getX() * PPM + 5,
getY() * PPM + 30,
false,
Expand Down
1 change: 0 additions & 1 deletion core/src/hu/wolfman/deimos/entities/Player.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ public void fire() {
Resources.get().sound("shoot").play();
bullets.add(new Bullet(
world,
new TextureRegion(Resources.get().texture("bullet")),
facingRight ? getX() * PPM + width - 5 : getX() * PPM + 5,
getY() * PPM + 30,
facingRight,
Expand Down

0 comments on commit 29c6448

Please sign in to comment.