Level Up (beginners)

3

Stats

3,920 visits, 5,208 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 2 Nov, 2014. Last updated 19 Feb, 2019

In this tutorial I will be explaining how to add a basic leveling system using Experience Points and using levels as conditions. This tutorial is for what I assume are beginners so I will break it down as much I can.

-

Getting Started

-

I will be teaching the beginners how to test this theory. If you want a quick explanation jump to Continuing To Level Up

-

Okay, assuming you have a new project open, add three sprites and 2 "text" objects to layout 1. The sprites are "Button1", "Button2", and "Button3" from largest to smallest. The texts are "Level" and "ExperiencePoints". Go to the button's properties and make the initial visibility to invisible. With "Level" go to properties and set text to "Level: 1". Same with "ExperiencePoints" - "Experience Points: 0"

-

-

Prerequisites

-

Right click anywhere on event sheet 1 and add 2 global variables, one Level and one ExperiencePoints. The Level should have an initial value of 1. Then add an event [System>Compare Variable> Level is greater or equal to 1 > button 1 > set visible] You can skip this step by leaving Button1's initial visibility to visible since you start off at level 1, but just for setting a pattern we'll do this. Add another event to have 2 conditions, one checking if Button1 is visible and one on left button clicked on Button1. This is setting it up so that if you weren't high enough level to click this button it wouldn't appear and you wouldn't be able to click it.

-

-

Getting Experience Points And Leveling Up

-

If you get confused by the over use of the phrase ExperiencePoints and wonder if it's the text object or the global variable : if at any point it includes numbers or compare it is the global variable, if it's set text then it's the text object.

-

Add an action to the double condition event [System > add to > ExperiencePoints > 5] This is self explanatory. Then add another action to the same event [ExperiencePoints > set text > "Experience Points: "&ExperiencePoints ] This sets your Experience Points text to show it every time you get more Experience Points. It is important you type in ("Experience Points: "&ExperiencePoints) that way it says what you want it to say in the quotes, and then also has the Global variable in the text. Now you want to add an event [System > compare value > experiencepoints > greater or equal to 50 > system > set value > level > 2] and then add another condition [Level > set text > "Level: "&Level]

-

-

Continuing To Level Up

Now just follow the pattern you set up for yourself.

-

-

Run the project and test it for yourself. If you did everything properly, you will click on the black box 10 times until you level up and the red box appears, and then level 3 and the blue box appears.

-

Summary

-

We learned how to gain experience and how to turn it into levels, along with making certain things happen when you are a certain level. We also learned that we can set a Text object up to show the level and experience using the formula ("Exact text"&Global Variable) The buttons are just to use as an example, where in a real game it would be killing an enemy or completing an action to award Experience Points.

-

To read more about leveling up in an RPG style visit my next tutorial.

  • 0 Comments

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