Hi,
I just began coding in DBPro yesterday and started using TDK's tutorials.
I have began working on a small 2D RPG project, however I am having trouble with variables (I think that's what this is called)
My problem is this:
I am trying to set a health value (so Health: 100) but entering it in the editor like this
if charactertype# = 1 then center text 400,300,
"Health: ";Health#
gives a syntax error.
I've tried to the hardest of my ability but I am not able to work this problem out.
Here is the rest of my code:
Rem Stupid RPG Game.
Rem Made by Dark Frager
Rem Magic, Do not touch.
Rem Sets Display mode, foreground colour, ink colour.
Set Display Mode 800,600,16
CLS RGB (255,255,255)
ink RGB(255,0,0),RGB(255,255,255)
Rem Character Creation
center text 400,300,"Made By Dark Frager"
wait 5000
CLS
center text 400,300,"Welcome to 2D RPG V1"
wait 2000
cls
center text 400,300,"Please enter your character name..."
input "Character Name: ";Name$
cls
center text 400,250,"What class do you want to play?"
center text 400,300,"1. Warrior"
center text 400,350,"2. Mage"
Repeat
I$=Inkey$()
Until Asc(I$)>48 and Asc(I$)<55
CLS
If I$="1" Then Print "Your character will be a Warrior"
If I$="2" Then Print "Your character will be a Mage."
If I$="1" Then CharacterType# = 1
If I$="2" Then CharacterType# = 2
wait 2000
cls
Rem Initialize Character types and Stats + Abilites etc..
if CharacterType# = 1 then Print "Your character is a warrior."
if CharacterType# = 1 then Health# = 100
if CharacterType# = 1 then Armour# = 200
if CharacterType# = 1 then Energy# = 100
if CharacterType# = 1 then Center Text 400,1,"Health: 100"
if CharacterType# = 1 then Center Text 400,11,"Armour: 200"
if CharacterType# = 1 then Center Text 400,21,"Energy: 100"
if CharacterType# = 2 then Print "Your character is a mage."
Rem Create the Game Field.
wait key
If anyone could help me that would be greatly appreciated.
Thanks!
Edit: Just fyi,
if CharacterType# = 1 then Center Text 400,1,"Health: 100"
if CharacterType# = 1 then Center Text 400,11,"Armour: 200"
if CharacterType# = 1 then Center Text 400,21,"Energy: 100"
is where the problem is. The values have been replaced with text as a placeholder.
Fruitella's a badman sweet, do you get me?