O GoConqr está de visual novo! Conte para nós o que você achou.

Mapa mental

Text-based Adventure Game: Part 1: Algorithm Challenge 2

Julia de Beer Digital Solutions Year 11 Inglês

Conteúdo do mapa

Text-based Adventure Game: Part 1: Algorithm Challenge 2

  1. Criteria

    • Context
      • If the player talks to the baker he will give the player a loaf of bread. If the player eats the bread 1 health point is restored (up to a maximum health of 5).
        • The player must be able to talk to the baker
        • The baker must give the player a loaf of bread if talked to
        • 1 health point must be restored if player eats bread
        • The maximum health must be 5 health points
          • If the player has 5 health points when eating bread, the health does not increase
    • Task
      • Write an algorithm that processes the player inputs in the table and returns the appropriate output message depending on the player location and contents in the player’s backpack.
        • The algorithm must be a function (modularisation)
        • The appropriate output must be displayed for the input
        • The output must depend on the player's location
        • The output must depend on the contents of the player's backpack/storage
  2. Ideation/Processing

    • Define function
      • Name function as baker
        • Include input data sets of (mapLoc, bakerMessage, backpackListLength, playerHealth, backpack, items)
          • Eg. BEGIN bread (mapLoc, bakerMessage, backpackListLength, playerHealth, backpack, items)
    • Define variables
      • Number of items in backpack
        • Eg. SET backpackListLength to number of items in backpack
      • Responses to valid action
        • Eg. SET bakerMessage = "You eat the bread."
      • Possible items in backpack
        • Eg. SET items[0] = "Bread"
      • Location of bakery
        • Eg. SET mapDesc[0] = "Bakery"
      • Backpack variable
        • Eg. backpack = []
    • Selection of output depending on input
      • Use of IF...THEN...ELSE statements
        • Use conditions to regulate selection
          • Eg. IF playerInput == "eat bread" AND backpacklistlength > 0 THEN ELIF playerInput == "eat bread" AND backpacklistlength NOT > 0 THEN
          • Eg. IF playerInput == "talk to baker" AND mapLoc = 0 THEN ELIF playerInput == "talk to baker" AND mapLoc = 0 THEN
          • Eg. IF playerInput == "eat bread" AND items[0] IN backpack THEN ELIF playerInput == "eat bread AND items[0] NOT IN backpack THEN
      • Account for user error
        • Eg . ELSE PRINT "I do not understand."
    • End
      • End function
        • END bread
      • End IF...ELSE statement
        • ENDIF
    • Prescribe correct message for situation
      • Eg. PRINT BakerMessgae[0]
        • User receives the text "You eat the bread."
      • Potential messages
        • "You eat the bread."
        • "You are not carrying the bread."
        • "The baker gives you a loaf of bread."
        • "The baker is not here."
    • Error messages
      • If the player types an invalid command
        • Eg. "I don't understand. Please try another action."
    • Actions
      • Interaction of items with backpack
        • Eg. ADD items[0] TO backpack
        • Eg. REMOVE items[0] TO backpack
  3. Input

    • The player's current location on the map
      • Variable name
        • mapLoc[ ]
      • Data type
        • Integer
          • Variable can range from 0 - 15 depending on the map location
    • The current contents of the player's backpack
      • Variable name
        • backpack[]
          • Contains items[]
        • backpacklistlength
          • Index length of the backpack array
      • Data type
        • Variable
          • Eg. backpack[0] = items[4]
        • Integer
          • Eg. backpacklistlength = 4
    • The possible contents of the backpack
      • Variable name
        • items[]
      • Data type
        • String
          • Eg. items[0] = "Bread"
    • The player's input
      • Variable name
        • playerInput
      • Data type
        • String
          • Eg. playerInput == "eat bread"
    • The player's current health
      • Variable name
        • playerHealth
      • Data type
        • Integer
          • Eg. 3
    • Error Messages
      • Data type
        • String
          • Eg. "I don't understand."
      • Variable name
        • errorMessages[]
    • Position of the bakery
      • Variable name
        • mapDesc[]
      • Data type
        • String
          • Eg. mapDesc[0] = "Bakery"
  4. Output

    • An array (list of statements) of responses to the input according to map location
      • Variable name
        • BakerMessage[]
      • Data type
        • String
          • Eg. BakerMessage[0] = "You eat the bread"
    • Statement of health
      • PRINT statement
        • Text that is displayed to player
        • Must change depending on the fullness of health
          • Eg. "You gain 1 health point."
          • Eg. "You gain no health points/are not hungry. To are already at maximum health."
    • Error Messages
      • Data type
        • String
      • PRINT statement
        • Eg. "I don't understand. Please try another command."
  5. Constraints/Limitations

    • See Text-based Adventure Game: Part 1: Algorithm Challenge 1
  6. Available Resources

    • See Text-Based Adventure Game: Part 1: Algorithm Challenge 1

Informações

Descrição
Year 11 Digital Solutions Mapa Mental sobre Text-based Adventure Game: Part 1: Algorithm Challenge 2, criado por Julia de Beer em 16-02-2021.
Criado por
Julia de Beer
Visualizações
0
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?