Basic Banking System Part 2/4

The first thing we need to do is have our bank teller welcome us and ask what we would like to do at the bank. Begin with a Show Text command that says something along the lines of “Welcome to the bank!”

After that, insert a Label (page 1) and call it reset. This will come in handy down the road.

For the next command, we need to use a variable to check and display the gold we are carrying. For this, choose the Control Variables (page 1) command.

Let’s create a new variable and call it Gold. In this variable, we will use the Set operation to check some Game Data, specifically, how much Gold we are carrying.

bank03

bank04

Before we hit the OK button to put in our next command, let’s go ahead and create the remaining variables we will need for our basic bank structure. At this point, we only need to assign them names. Create the following variables and write down what their ID numbers are. Their ID numbers are the numbers that come before their name.

#6: Gold

#7: Account

#8: Withdraw

#9: Deposit

NOTE: In my examples, my ID numbers are 6: Gold, 7: Account, 8: Withdraw, and 9: Deposit. You will need to keep track of which variable IDs you are using in your game for this project.

Before you hit the OK button, make sure you highlight the Gold variable.

Now let’s put in our next command, another Show Text. Have your bank teller say something along the lines of “Your account has \v[7] at the moment. What would you like to do?\$”

You may notice some coding in this show text command. The \v[7] code will call up the numeric value of variable ID number 7, which just happens to be my account variable. Whatever number is stored into this variable will replace the code and be displayed in the text while the game is running. Additionally, the \$ code will cause the gold window to be displayed in the top corner of the screen while this text message is being displayed.

If you click the Preview button in the Show Text Editor, the value of your account variable will be 0. This is because no other number has been set to it and none will be until you are actually playing the game.

Immediately following this, inset a Show Choices (page 1) command with the following choices:

  1. Withdraw
  2. Deposit
  3. Information
  4. Never mind

Additionally, this command should also have the Cancel setting set to Choice #4. This would be triggered if the player were to attempt to cancel out of the choice.

So far, our code looks like this:

bank014

Notice the blank lines beneath When Withdraw and When Deposit. All the programming we do from this point will be inside of either of those conditions. Let’s start with When Withdraw.

Prevpage buttonNextPage Button

 

 

 

 

*Please note that no tutorial may be copied or reproduced without the expressed written authorization of PODS Game Design. Any use of these tutorials to create a system(s) or function(s) in any game must be properly credited. Please contact PODS Game Design at podsgamedesign@gmail.com for further information.*