From the course: Game Development Foundations: Game-Related Math
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Experience calculator - JavaScript Tutorial
From the course: Game Development Foundations: Game-Related Math
Experience calculator
- [Tutor] For our next formula example, we're going to create an experience calculator. Experience points are used to determine how a player levels up in a game. These are common in role playing games, but can be used in any type of game, where the player needs to get to the next level and you need to determine the amount of points they need in order to reach that level. To get started, let's go into the Exercise Files folder and go into the Chapter 03 folder. Next, go into the 03_02 folder and then into the Start folder. Here you'll find two files, an HTML file and a Javascript file. Let's select both of them and open them in our text editor of choice. Let's start by copying all of the code inside of the xp-calculator Javascript file and switch over to Codepen. From here, we'll create a new pen. We'll call this XP Calculator. We can paste our Javascript into the Javascript tab and before we copy over the HTML, let's go into the settings, select the Javascript tab and scroll to the…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.