GoalTile.java 704 B

12345678910111213141516171819202122232425262728
  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 class GoalTile extends BaseCollisionTile
  6. {
  7. public GoalTile(float tMinX, float tMinY, float tMaxX, float tMaxY)
  8. {
  9. super(tMinX, tMinY, tMaxX, tMaxY, Tile.SIZE * 0.1f, Tile.SIZE * 0.1f, Tile.SIZE * 0.9f, Tile.SIZE * 0.9f);
  10. }
  11. @Override
  12. public void onEntityCollide(Entity ent, int x, int y, Face face, Level l)
  13. {
  14. if(ent.getItemCollector().isHero())
  15. {
  16. l.finishLevel();
  17. }
  18. }
  19. @Override
  20. public float getOffsetY()
  21. {
  22. return 1.0f;
  23. }
  24. }