X-Git-Url: https://deadsoftware.ru/gitweb?p=cavedroid.git;a=blobdiff_plain;f=core%2Fsrc%2Fru%2Fdeadsoftware%2Fcavecraft%2Fgame%2FGameWorld.java;h=064eca58ffa72052a0b6afd0695aea1772c159c2;hp=daa00c004af21ce8356aeec57d0f276d18865376;hb=f7cc93fff73659b11d3666cdfd92efca1bf403dd;hpb=6d02313555a768027186198366abf213b0557fb5 diff --git a/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java b/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java index daa00c0..064eca5 100644 --- a/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java +++ b/core/src/ru/deadsoftware/cavecraft/game/GameWorld.java @@ -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); }