DEADSOFTWARE

Fix bugs
[cavedroid.git] / core / src / ru / deadsoftware / cavecraft / game / GameWorld.java
index daa00c004af21ce8356aeec57d0f276d18865376..064eca58ffa72052a0b6afd0695aea1772c159c2 100644 (file)
@@ -100,10 +100,14 @@ public class GameWorld {
         }
     }
 
-    public Vector2 getSpawnPoint() {
-        float x=0, y=0;
+    public Vector2 getSpawnPoint(int x) {
+        int y=0;
+        while (true) {
+            y++;
+            if (getForeMap(x,y)>0 && Items.BLOCKS.getValueAt(getForeMap(x,y)).collision) break;
+        }
         x = x*16 + 4;
-        y *= 16;
+        y = y*16 - 32;
         return new Vector2(x,y);
     }