Level Up (beginners)

3
  • 26 favourites

Stats

3,365 visits, 4,465 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.

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.

  • 1 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Great work!! I noticed that some authors of tutorials provide a .capx file with the files/objects included. Is this something you may do going forward? Thanks again for your time and work on this! *Disregard, I see this is almost 8 years and a whole version old, link to "next tutorial" doesn't work either*