Added mouse over
This commit is contained in:
parent
22965dbdd1
commit
c6ba0ea532
6 changed files with 129 additions and 87 deletions
|
|
@ -3,7 +3,6 @@ package ei.game.scene;
|
|||
import ei.engine.math.Vector2f;
|
||||
import ei.engine.math.Vector2i;
|
||||
import ei.engine.math.Vector3f;
|
||||
import ei.engine.scene.Box;
|
||||
import ei.engine.scene.Node;
|
||||
import ei.engine.scene.Sprite;
|
||||
|
||||
|
|
@ -76,14 +75,24 @@ public class Map {
|
|||
* @return True if empty else false
|
||||
*/
|
||||
public boolean isPosEmpty(int x, int y){
|
||||
if(x < 0 || y < 0 || x >= width || y >= hight)
|
||||
return false;
|
||||
if(map[x][y] == null){
|
||||
if(posExist(x,y) && map[x][y] == null){
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the given pos exists on the map
|
||||
* @param x The x pos
|
||||
* @param y The y pos
|
||||
* @return True if the given pos exists on the map
|
||||
*/
|
||||
public boolean posExist(int x, int y){
|
||||
if(x < 0 || y < 0 || x >= width || y >= hight)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the object at the pos
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue