X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavedroid%2Fgame%2Fmobs%2FFallingGravel.java;h=23cf1dcc836de3b434aa7e9deea52ca53b691568;hb=f4d52e3e4a3712050532786fca0aded5ff8b5a03;hp=fb567049394d79329a7ced59fb7a770c1224f2e3;hpb=17c1be4c02b27fefa1bf6abd0547ac7e9743d493;p=cavedroid.git diff --git a/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java b/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java index fb56704..23cf1dc 100644 --- a/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java +++ b/core/src/ru/deadsoftware/cavedroid/game/mobs/FallingGravel.java @@ -2,10 +2,8 @@ package ru.deadsoftware.cavedroid.game.mobs; import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.math.Vector2; -import org.jetbrains.annotations.NotNull; -import ru.deadsoftware.cavedroid.misc.Assets; - -import static ru.deadsoftware.cavedroid.GameScreen.GP; +import ru.deadsoftware.cavedroid.game.GameItems; +import ru.deadsoftware.cavedroid.game.GameWorld; /** * Falling gravel is actually a mob, that spawns in place of gravel when there is no block under it, @@ -15,18 +13,19 @@ public class FallingGravel extends Mob { /** * Creates a FallingGravel mob at coordinates + * * @param x X in pixels * @param y Y in pixels */ public FallingGravel(float x, float y) { super(x, y, 16, 16, Direction.LEFT, Type.GRAVEL); - move = new Vector2(0, 1); + mMove = new Vector2(0, 1); } @Override - public void ai() { - if (move.isZero()) { - GP.world.setForeMap(getMapX(), getMiddleMapY(), 11); + public void ai(GameWorld gameWorld) { + if (mMove.isZero()) { + gameWorld.setForeMap(getMapX(), getMiddleMapY(), 11); kill(); } } @@ -36,8 +35,8 @@ public class FallingGravel extends Mob { } @Override - public void draw(@NotNull SpriteBatch spriteBatch, float x, float y) { - spriteBatch.draw(Assets.gravelSprite, x, y); + public void draw(SpriteBatch spriteBatch, float x, float y) { + spriteBatch.draw(GameItems.getBlockTex(11), x, y); } }