Click to See Complete Forum and Search --> : help with rpg
tonyp
Feb 22nd, 2000, 12:11 AM
if the energy is 100 and then you defeat a enemy then you get more energy but how do i get the new energy in an other form.
chach
Feb 22nd, 2000, 04:34 AM
Say your original energy is the value in lable1 on form1. After defeating the enemy, your form1.visible = false, and form2.visible = true. On form2 you have another label1 for the new energy level. Here is how I would do it:
'new energy label
'x = the desired increasing amount
label1.caption = val(form1.label1 + x)
Fox
Feb 22nd, 2000, 02:55 PM
Well, this will work but it's a very stupid way.
Add a module where you can declare global vars so you can use them on each form.
-
'In module
Global A as Long
'In any form
A = 10
'In another form
Caption = A
-
Freshman
Mar 1st, 2000, 09:15 AM
Go to a module and say:
Global energy as integer
then your variable will work in every form.
Easy as pie
3ic-IA
Mar 1st, 2000, 06:19 PM
Private Sub Form2_Load()
lblENG.Caption = Form1.lblENG.Caption
End Sub
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.