In this video Jesse Freeman teaches you the foundation of building out an RPG battle loop. The battle loop consists of offering the player to perform a battle action such as attack or run. Once an action is performed it is analyzed then a new action is presented to the player until the battle is over or the player loses.
- [Voiceover] Now we're ready to create…our basic battle loop.…In order to do this,…let's open back up our BattleWindow class.…Here, we're gonna create a new private method…with the return type of Ienumerator,…and we're gonna call it NextAction.…Inside of this method,…we're gonna have a yield return,…and we're gonna create a new WaitForSeconds…and pass in 2.…Next, we're gonna display the actions group…by setting its active state to true.…
Now, at the end of the StartBattle method,…let's go ahead and start a new Coroutine…and call our next action.…What we're gonna do is set up a loop…that when the battle starts,…we use a delay to call the next action.…The NextAction will display the action the player can use,…and when the player clicks a button,…the action will go away,…the action will be executed,…and then a new action will be presented to the player again.…In order for this to work,…we're gonna need to create a new public method…that our buttons can actually call.…
To do this,…we're gonna create a public method with a return type…
- Preparing the user interface
- Creating game and message windows
- Building a battle window
- Adding a monster and action buttons
- Creating an actor class
- Adding player and monster attack actions
- Triggering battles from the map
- Ending a battle
- Cleaning up the battle and attack systems
- Rewarding the player
Skill Level Intermediate
1. Preparing the UI
2. Message Window
3. The Battle Window
4. Actor Classes
5. Battle Actions
6. Cleaning Up Combat
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.