Initial Map

Having completed enough to create an initial map i set about designing the level.

Initial Level Design

For the first part our hero will have no ‘Hero Mode’ activations, and will have to avoid the in-place monsters (which will seek) and the random spawn monsters (which will just move randomly).

The map design ensures our hero has enough to make risky moves that increase in skill/dexterity to complete, but are awarded higher scores. The gaps in the walls are intentionally off-set to the entrance making the hero cross the room, but if the treasure is to be avoided in the later stages, a dash across the room can be made, but at a lower score.

The food and drink is added, with more towards the of the level ready to combat the dragon. The dragon will have ‘health’ which will require several attacks in hero mode to win, also the special red key will need to be picked up to allow our hero to escape, having defeatd the dragon with all his treasures !

I made code updates in the designer to reflect the button modes and actions, i.e.

Place Treasure, not pill

and to create hero mode required adjust the shape and action within the code

to place-pellet
  ask patch (round mouse-xcor) (round mouse-ycor)
  [
    ifelse pcolor != black
    [ user-message "You cannot place a treasure on top of a wall or a gate." ]
    [
      if not any? turtles-here
      [
        sprout-treasures 1
        [
          set color yellow
          set powerup? false
          set shape "box"
        ]
        set treasures-grid? true
        set pcolor black
      ]
    ]
  ]
end

to hero-mode
  if any? treasures-on patch mouse-xcor mouse-ycor
  [
    ask one-of treasures-on patch mouse-xcor mouse-ycor
    [
      set powerup? not powerup?
      ifelse powerup?
      [ set shape "circle" ]
      [ set shape "pellet" ]
      while [ mouse-down? ] [ ] ;; wait until mouse button is released
    ]
  ]
end

The next step is within the game-code to add the additional code to update the UI, with values for each of the keys and also the dragon health, as well as the spawning of random monsters thru out the dungeon.

Leave a Reply

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