<!-- Time to dive deeper into more CSS properties.  -->
<!-- Borders can be added to surround elements. -->

<style>
    /* Remember to select a class, use a "." */
    .content {
        /* To add a default border, add a border-style. */
        /* Border styles can be: solid, dotted, ... */
        /* ... inset, double, groove, ridge, outset */
        border-style:double;
    }

<!-- Margin and Padding are used to layout elements. -->
<!-- Margin is the space between elements. -->
<!-- Padding is distance between the content and... -->
<!-- ... edge of an element. -->

<style>
    body {
        text-align:center;
    }
    img {
        border:1px black solid;
    }

// Use game.randomInteger(min,max) to add randomness!
game.spawnPlayerXY("knight", 40, 35);
game.addSurviveGoal();
game.addDefeatGoal(8);

function onSpawn(event) {
    while(true) {
        var unit = event.target;
        var enemy = unit.findNearestEnemy();
        if(enemy) {
            unit.attack(enemy);
        }
    }
}

<!-- The <script> tag lets you add JavaScript! -->
<!-- The browser can only read JavaScript, not Python! -->

<script>
    // -JavaScript should be written inside <script> tags.
    // CodeCombat uses jQuery to make JavaScript easier.
    // jQuery is a function, like moveLeft().
    // Except instead of "moveLeft()", it's just: "$()"
    // Finds #theImage.
    var image = $("#theImage");
    // Setting the image's "background-color" to "red".

<!-- It is possible to make your website interactive! -->
<!-- jQuery includes ".on()" to watch for events. -->
<!-- The "click" occurs when an element is clicked. -->

<script>
    // Remember only JavaScript goes inside <script> tags.
    // This sets the button's text color to "blue".
    var button = $("#theButton");
    

// game.time to czas ,który upłyną  w grze.
game.spawnPlayerXY("guardian", 10, 35);
game.addSurviveGoal();
game.addDefeatGoal(5);

function onSpawn(event) {
    while(true) {
        var unit = event.target;
        var enemy = unit.findNearestEnemy();
        if(enemy) {
            unit.attack(enemy);
        }
    }
}