Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / Cant update the text on the screen

Author
Message
G_Unit
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Sacramento, California
Posted: 9th Jul 2004 20:03
I set up an array called Player(2). Player(1)=100 , and Player(2)=0

I have the subs

Do
Gosub _playerstart
GoSub _Battle
Gosub _encounter
Loop


_playerstart:
Player(1)=100
Player(2)=0
Set cursor 20,20
Print "Health is At ",Player(1)
set cursor 20,40
Print "? level is At ",Player(2)


_Battle:
Set cursor 20,80
Print "Zombies Health is At ",Zombie(1)
Set cursor 20,100
Print "Zombie has ",Zombie(2)," Limbs"
SawZombie=1

_encounter:

If SawZombie=1
Player(1)=Player(1)+40
print "saw zombie"
endif

When SawZombie=1 , i want Player(2) array to increase by 40 , but it is not updating itself. Ive looked over the forum for a solution but could not find one. Help would be appreciated , Thank You
Zach

HaHaHa, Its G-Unit Baby...Running a Amd AthlonXP 2800 , 120 GB , 512 MB , Radeon 7000
jasuk70
21
Years of Service
User Offline
Joined: 3rd Dec 2002
Location: Hemel Hempstead
Posted: 9th Jul 2004 21:07
Well you have Player(1) increasting not Player(2) in your code above, shouldnt it be:

_encounter:

If SawZombie=1
Player(2)=Player(2)+40
print "saw zombie"
endif

Jas

----
"What is this talk of 'release'? Klingons do not'release' software. It escapes leaving a bloody trail of developers and quality assurance people in its wake!"
G_Unit
21
Years of Service
User Offline
Joined: 30th Aug 2003
Location: Sacramento, California
Posted: 10th Jul 2004 02:27
I changed player(1)=Player(1)+40 to player(2)=Player(2)+40 but when sawzombie=1 , where im printing

Print "? level is At ",Player(2)

is still not updating to the current value.

HaHaHa, Its G-Unit Baby...Running a Amd AthlonXP 2800 , 120 GB , 512 MB , Radeon 7000
SandraD
20
Years of Service
User Offline
Joined: 30th May 2004
Location: Down on the corner, out in the street.
Posted: 10th Jul 2004 05:05
Well let's see... first off, I don't see any RETURNs for the subroutines. It would help if you posted a little more. Otherwise, I have no idea why it's not working, unless SawZombie is not global and this is in a function not shown.

Any truly great code should be indisguishable from magic.

Login to post a reply

Server time is: 2024-09-22 16:27:13
Your offset time is: 2024-09-22 16:27:13