A Basic Turn-Based Battle System

27

Index

Features on these Courses

Attached Files

The following files have been attached to this tutorial:

.c3p

basic-tb-battle.c3p

Download now 63.64 KB

Stats

13,019 visits, 28,189 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 5 Mar, 2021.
.C3P

basic-tb-battle.c3p

Download now 63.64 KB

Welcome to the first in a series of tutorials about building up a turn-based battle system. This tutorial will eventually become part of a larger course covering all sorts of turn-based mechanics in a Pokemon style.

This first part will cover the absolute basics and will create a small but functioning turn-based system. It does use functions so you will need some knowledge of how functions work within Construct.

There is an example file included in this tutorial and the event sheet has a mini explainer about how to use the project.

A basic form of a turn-based battle system can simply be two objects, taking it in turns to inflict a set amount of damage to each other. When one loses its health, the battle is over. This form is where we're going to start this course.

To build the project, you'll need seven objects – three sprites, three text objects and the mouse object. Two of the sprites will be our two combatants – the player and the opponent, and the third will be the attack button. The two combatant objects also have the Flash behavior applied to them, and several instance variables: HP, Attack and Speed.

The three instance variables act as stats for our two combatants. You can set these to whatever you like, I've chosen the same stats for both combatants – 50 HP, 15 Attack and 5 Speed.

Similarly, two of the text objects will be for the player and opponent: an HP display for each. The third text object will be used to show the Game Over text. Finally, you'll need the mouse object to actually control the game.

I've chosen to set the layout up in a pokemon-esque style, so the player is in the foreground on the left, and the opponent in the background on the right. Their HP boxes are above each sprite, the Game Over text set to initially invisible and placed in the middle and the attack button placed in the bottom right of the viewport.

The project also needs six global variables to run:

  • PlayerTurn, Boolean
  • CurTurn, String
  • NextAction, String
  • PlayerMoved, Boolean
  • OppMoved, Boolean
  • GameOver, Boolean

Next, we'll define the functions needed for this project before diving into the rest of the event sheet.

  • 9 Comments

  • Order by
Want to leave a comment? Login or Register an account!