public void step() {
        int[][] activeMap = getActiveMap();
        boolean mapChanged = false;
        enemyMoveCounter++;

        for (int i = 0; i < explosions.size(); i++) {
            Explosion e = explosions.get(i);
            if (e.isDestroyed()) {
                explosions.remove(i);
                i--;
            }
        }

        playerAction(delegate.getInput(), activeMap);

        boolean enemyGo = enemyMoveCounter == 10;

        if (enemyGo)
            enemyMoveCounter = 0;

        for (int i = 0; i < enemies.size(); i++) {
            Enemy e = enemies.get(i);
            if (e.isDestroyed()) {
                enemies.remove(i);
                i--;
                continue;
            }
            enemyAction(e, e.calcPath(player.getX(), player.getY(), bombs, activeMap), enemyGo, activeMap);
        }


        for (int i = 0; i < bombs.size(); i++) {
            Bomb b = bombs.get(i);
            if (b.isDestroyed() || activeMap[b.getY()][b.getX()] == -3) {
                mapChanged = true;
                explode(b.blowUp(map));
                bombs.remove(i);
                i--;
            }
        }

        if (mapChanged)
            delegate.setBackgroundImage(map);

        delegate.repaint();
    }