Nesta etapa final, você encontrará todo o código usado para criar o projeto. Cada cabeçalho abaixo corresponde ao nome do arquivo no projeto em que o código está.
Tente alterar o código e descobrir mais maneiras de acrescentar outras funcionalidades ao minijogo. Confira a seguir algumas ideias como ponto de partida:
Adicione mais níveis para o personagem solucionar.
Controle a quantidade de tempo que o jogador demorou para solucionar o quebra-cabeça ou quantos movimentos o personagem realizou por nível.
Adicione mais comandos para o personagem criar quebra-cabeças mais complexos, como pegar itens e colocá-los no tabuleiro.
submodules.verse
O arquivo de projeto submodules.verse define o nível de acesso para submódulos e ativos no projeto para que possam ser usados no código Verse. Para obter mais informações, confira a etapa 5. Como controlar o PNJ com a interface de usuário e Como expor ativos em Verse.
# This file sets the access levels for submodules in the project.
# Specifically, this file is making art assets accessible to the Verse files in the project
# so textures, meshes, and materials can be used in the UI and in the game.
# The submodule Textures.MiniGameUI below is the same as the folder
# Textures/MinigameUI that you can see in the project's Content Browser.
Textures := module:
MiniGameUI<public> := module{}
# The submodule VerseCommander below is the same as the folder
verse_starter_tags.verse
O arquivo de projeto verse_starter_tags.verse contém a definição para a Tag de Jogabilidade verse_commander_minigame_tag que pode ser usada pelo código de PNJ de Personagem do Comandante Verse para encontrar o dispositivo minijogo Comandante Verse e escutar seus eventos. Para obter mais informações, confira a etapa 1. Como criar comportamento de PNJ.
# This file contains the Gameplay Tags for the project.
# You can use Gameplay Tags to tag an object in the island
# and be able to query all objects that have the tag during the game using Verse.
using { /Verse.org/Simulation/Tags }
# The verse_commander_minigame_tag is for the Verse Commander Character NPC script
# to be able to find the Verse Commander Minigame device and listen to its events.
verse_commander_minigame_tag := class(tag){}
commands.verse
O arquivo de projeto commands.verse no submódulo VerseCommander contém a representação de dados de todos os comandos que o PNJ pode receber. Para obter mais informações, confira a etapa 4. Como representar dados de comando.
# This file contains the data representation of all the commands that the NPC can receive
# and utilities for the data to help with debugging and troubleshooting issues.
# Each type of command that the NPC can perform will be an instance of this class.
# The class has the unique specifier to make instances of the class comparable.
# The class has the computes specifier to be able to instantiate it at module-scope.
# The class has the abstract specifier so it cannot be instantiated directly, and
# requires subclasses to implement any non-initialized functions, like DebugString().
command := class<computes><unique><abstract>:
DebugString():string
gameboard.verse
O arquivo de projeto gameboard.verse no submódulo VerseCommander contém os dados e o comportamento do tabuleiro. Para obter mais informações, confira a etapa 2. Como definir tabuleiros para o jogo.
# This file contains the gameboard structure and how it works.
# The gameboard knows where the NPC is supposed to start on the board
# how many obstacles / barriers there are to getting to the end goal,
# and what the end goal is and when it has been reached.
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags }
# An obstacle on the gameboard, with an associated set of
ui_manager.verse
O arquivo de projeto ui_manager.verse no submódulo VerseCommander contém o código para criar e modificar a aparência da interface de usuário. Para obter mais informações, confira a etapa 5. Como controlar o PNJ com a interface de usuário.
# This file contains all the code to create and modify the UI
# in the Verse Commander minigame.
# The UI for the game contains:
# - Buttons that map to commands for the NPC: forward, turn left, turn right.
# - An execute button that tells the NPC to perform the queue of commands.
# - A remove button that removes the last command added.
# - A reset button that resets the current board and clears out the command queue.
# - A dynamic list of commands that grows wider when a player adds commands and shrinks when a player removes commands.
using { /Fortnite.com/Devices }
verse_commander_minigame.verse
O arquivo de projeto verse_commander_minigame.verse no submódulo VerseCommander contém o dispositivo Verse que gerencia o minijogo. Para obter mais informações, confira a etapa 6. Como gerenciar o loop de jogo.
# This device is in charge of managing the minigame.
# In its Details panel in the editor, you can:
# - Define how many gameboards there are
# - The order you play the gameboards
# - All the details of the gameboard such as their obstacles.
using { /Fortnite.com/Devices }
using { /Fortnite.com/UI }
using { /UnrealEngine.com/Temporary }
using { /UnrealEngine.com/Temporary/Diagnostics }
verse_commander_character.verse
O arquivo de projeto "verse_commander_character.verse" no submódulo "VerseCommander" contém a lógica para o PNJ do minijogo. Para obter mais informações, confira a etapa 1. Como criar comportamento de PNJ.
# This file handles the logic for the gameboard NPC. The NPC waits for commands from
# verse_commander_minigame, then executes movement based on those commands using navigation targets.
# It also tracks the NPC's position using a visual arrow that updates after each command.
using { /Fortnite.com/AI }
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /Verse.org/Assets }