Exemple #1
0
 protected boolean IsLeftCollision(int dx)
 {
     return(tileMap.at((hitBox.GetPosX() - dx) / AssetManagerProxy.GetMapTileSize(),
                       hitBox.GetPosY() / AssetManagerProxy.GetMapTileSize()) == Tile.WALL ||
            tileMap.at((hitBox.GetPosX() - dx) / AssetManagerProxy.GetMapTileSize(),
                       (hitBox.GetPosY() + hitBox.GetHeight()) / AssetManagerProxy.GetMapTileSize()) == Tile.WALL);
 }
Exemple #2
0
 protected boolean IsDownCollision(int dy)
 {
     return(tileMap.at(hitBox.GetPosX() / AssetManagerProxy.GetMapTileSize(),
                       (hitBox.GetPosY() + hitBox.GetHeight() + dy) / AssetManagerProxy.GetMapTileSize()) == Tile.WALL ||
            tileMap.at((hitBox.GetPosX() + hitBox.GetWidth()) / AssetManagerProxy.GetMapTileSize(),
                       (hitBox.GetPosY() + hitBox.GetHeight() + dy) / AssetManagerProxy.GetMapTileSize()) == Tile.WALL);
 }
    public override List <Entity> SpawnAt(int x, int y, SingleObject <Entity> f)
    {
        if (f == null || !tileMap.CanSpawnAt(x, y))
        {
            return(new List <Entity>());
        }
        List <Entity> enemies = new ArrayList <>();

        enemies.Add(f.Create(x * AssetManagerProxy.GetMapTileSize(), y * AssetManagerProxy.GetMapTileSize(), this.tileMap));
        return(enemies);
    }