DEADSOFTWARE

Code improvements
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / mobs / FallingGravel.java
index de841190239a0d541bc3a84c59581017dd789ca5..23515f40a4079f5d311e666ee3a549f96d6154b0 100644 (file)
@@ -1,21 +1,15 @@
 package ru.deadsoftware.cavecraft.game.mobs;
 
 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
-import com.badlogic.gdx.math.Rectangle;
 import com.badlogic.gdx.math.Vector2;
-import ru.deadsoftware.cavecraft.game.Items;
+import ru.deadsoftware.cavecraft.game.GameItems;
 import ru.deadsoftware.cavecraft.misc.Assets;
 
 public class FallingGravel extends Mob {
 
-    public FallingGravel(int x, int y) {
-        dir = 0;
-        position = new Vector2(x, y);
-        move = new Vector2(0, 1);
-        width = 16;
-        height = 16;
-        canJump = false;
-        dead = false;
+    public FallingGravel(float x, float y) {
+        super(x, y, 16, 16, 0);
+        mov = new Vector2(0, 1);
     }
 
     @Override
@@ -28,12 +22,7 @@ public class FallingGravel extends Mob {
 
     @Override
     public void draw(SpriteBatch spriteBatch, float x, float y) {
-        spriteBatch.draw(Assets.blockTex[Items.blocks.get("gravel").getTex()], x, y);
-    }
-
-    @Override
-    public Rectangle getRect() {
-        return new Rectangle(position.x, position.y, width, height);
+        spriteBatch.draw(Assets.blockTex[GameItems.getBlock(11).getTex()], x, y);
     }
 
     @Override