DEADSOFTWARE

Add logic to some blocks and fluids
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / mobs / FallingSand.java
1 package ru.deadsoftware.cavecraft.game.mobs;
3 import com.badlogic.gdx.graphics.g2d.SpriteBatch;
4 import com.badlogic.gdx.math.Rectangle;
5 import com.badlogic.gdx.math.Vector2;
6 import ru.deadsoftware.cavecraft.game.GameProc;
7 import ru.deadsoftware.cavecraft.game.Items;
8 import ru.deadsoftware.cavecraft.misc.Assets;
10 public class FallingSand extends Mob {
12 public FallingSand(int x, int y) {
13 dir = 0;
14 position = new Vector2(x, y);
15 moveX = new Vector2(0, 0);
16 moveY = new Vector2(0, 1);
17 width = 16;
18 height = 16;
19 canJump = false;
20 dead = false;
21 }
23 @Override
24 public void ai() {
25 }
27 @Override
28 public void changeDir() {
29 }
31 @Override
32 public void draw(SpriteBatch spriteBatch, float x, float y) {
33 spriteBatch.draw(Assets.blockTextures[Items.BLOCKS.get("sand").getTexture()],x, y);
34 }
36 @Override
37 public Rectangle getRect() {
38 return new Rectangle(position.x, position.y, width, height);
39 }
41 @Override
42 public int getType() {
43 return 10;
44 }
46 }