
-----------------------------------
shoobyman
Sun Feb 12, 2006 6:01 pm

RPG game eperience calculating problem
-----------------------------------
This is my code for my RPG game, as you can see, when you kill the black dot, you keep getting exp, i want it to just add exp once then it is over

to help me, you need to know the controls:
arrow keys to move
when you get close to the black dot, game pauses (it enters attack mode)and you must click to attack, the stats in the top corner change to show your HP and enemy HP.

please help me solve the EXP problem.
setscreen ("offscreenonly")

var x, y, button : int
var playerx : int := 50
var playery : int := 50
var playerDEF, playerATK, playerMGC, playerHP, playerLVL, playerdamage, prandATK, erandATK, playerEXP : int
var enemyDEF, enemyATK, enemyMGC, enemyHP, enemyLVL, enemyx, enemyy, enemydamage, enemyEXP : array 1 .. 5 of int
var chars : array char of boolean

playerDEF := 5
playerATK := 5
playerMGC := 1
playerLVL := 1
playerHP := 100
playerEXP := 1
enemyx (1) := 200
enemyy (1) := 200
enemyDEF (1) := 3
enemyATK (1) := 5
enemyMGC (1) := 1
enemyLVL (1) := 1
enemyHP (1) := 75

loop
    randint (enemyEXP (1), 5, 15)
    Mouse.Where (x, y, button)
    View.Update
    delay (20)
    cls
    drawfilloval (playerx, playery, 10, 10, 12)
    drawfilloval (enemyx (1), enemyy (1), 10, 10, 7)
    Input.KeyDown (chars)
    locate (1, 1)
    if chars (KEY_UP_ARROW) then
        playery += 2
    end if
    if chars (KEY_RIGHT_ARROW) then
        playerx += 2

    end if
    if chars (KEY_LEFT_ARROW) then
        playerx -= 2

    end if
    if chars (KEY_DOWN_ARROW) then
        playery -= 2
    end if
    put "enemy HP: ", enemyHP (1) ..
    locate (2, 1)
    put "Your HP: ", playerHP ..
    locate (3, 1)
    put "Your EXP: ", playerEXP ..

    if playerx >= enemyx (1) - 20 and playery >= enemyy (1) - 20 and playerx 