Tile.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. package me.hammerle.supersnuvi.tiles;
  2. import me.hammerle.supersnuvi.entity.Entity;
  3. import me.hammerle.supersnuvi.util.Face;
  4. import me.hammerle.supersnuvi.gamelogic.Level;
  5. public abstract class Tile
  6. {
  7. public final static int SIZE = 32;
  8. public final static float SIZE_SCALE = SIZE / 32.0f;
  9. public boolean shouldAiUseCollisionBox(int x, int y, Level l)
  10. {
  11. return true;
  12. }
  13. public void onEntityCollide(Entity ent, int x, int y, Face face, Level l)
  14. {
  15. }
  16. public void tick()
  17. {
  18. }
  19. public void reset(Level l)
  20. {
  21. }
  22. public void reset(int x, int y, Level l)
  23. {
  24. }
  25. public int getBottleScore()
  26. {
  27. return 0;
  28. }
  29. public float getTextureMinX(int x, int y, Level l)
  30. {
  31. return 0.0f;
  32. }
  33. public float getTextureMaxX(int x, int y, Level l)
  34. {
  35. return 0.0625f;
  36. }
  37. public float getTextureMinY(int x, int y, Level l)
  38. {
  39. return 0.0f;
  40. }
  41. public float getTextureMaxY(int x, int y, Level l)
  42. {
  43. return 0.0625f;
  44. }
  45. public float getOffsetX()
  46. {
  47. return 0.0f;
  48. }
  49. public float getOffsetY()
  50. {
  51. return 0.0f;
  52. }
  53. public float getWidth()
  54. {
  55. return Tile.SIZE;
  56. }
  57. public float getHeight()
  58. {
  59. return Tile.SIZE;
  60. }
  61. public boolean shouldRender(int x, int y, Level l)
  62. {
  63. return true;
  64. }
  65. public boolean isMoveColliding(float minX, float minY, float maxX, float maxY, int x, int y, Level l)
  66. {
  67. return false;
  68. }
  69. public boolean isColliding(float minX, float minY, float maxX, float maxY, int x, int y, Level l)
  70. {
  71. return false;
  72. }
  73. public Face getCollidingFace(float minX, float minY, float maxX, float maxY, int x, int y, Level l)
  74. {
  75. return Face.NULL;
  76. }
  77. public final boolean hasMoveBox(Level l)
  78. {
  79. return isMoveColliding(0.0f, 0.0f, Tile.SIZE, Tile.SIZE, 0, 0, l);
  80. }
  81. }