The Dragon !

Our ‘end level’ monster in the maze will the scary dragon. The Dragon will guard the final red key to exit the game. To defeat the dragon it will require maxium health and a power-up pill at the same time, so timing is critical – placement of these will ensure that it will be challenging, but not impossible.

Firstly, there was no dragon icon, so i created one. I found a knitting patten to copy as these are quite ‘blocky’ like the graphic editor.

Creating a button and associated code was an iteration of the key placements

breed [ dragons dragon ]
    if tool = "Place Dragon"
    [ place-dragon]
to place-dragon
  ifelse [pcolor] of patch round mouse-xcor mouse-ycor != black
  [ user-message "You must place the key on a corridor space, not a wall or a gate." ]
    ask dragons
    [ setxy (round mouse-xcor) (round mouse-ycor) ]

Whereby i was able to add the dragon to the designer

dragon added to editor and placed

Whilst the images currently look quite small, this will be corrected when the ‘setup’ adjust the world and patch sizes so they become more visable.

Leave a Reply

Your email address will not be published. Required fields are marked *