|
-
Feb 19th, 2003, 11:50 AM
#1
Thread Starter
Hyperactive Member
How to run two instances of the same function???
Hello every1,
I'm making a clone of arkanoid. Now when a brick is hit, apowerup falls down. The powerup reached half way, when another brick is hit and another powerup falls down. I wanna know, how can i manage both the powerUp?? How achieve this. Have i made myself clear.
If Not VB Then Exit
------------------------------------------------
visit me @ http://mzubair.50g.com/
-
Feb 19th, 2003, 12:19 PM
#2
Addicted Member
Create an array for all the powerups.
-
Feb 19th, 2003, 12:24 PM
#3
Fanatic Member
Ahh. and I thought you meant recursion
You`ll need an array, as one varaible can`t be two things at once.
Ex:
VB Code:
dim x(0 to 4)
sub command1_click(llallala)
x(0) = 1
x(1) = x*2
x(2) = 3
x(3) = x(3)+1
x(4) = 24
for a = 0 to 4
msgbox x(a)
next a
end sub
Don't pay attention to this signature, it's contradictory.
-
Feb 19th, 2003, 04:44 PM
#4
Fanatic Member
Instead of having it to be preset in the For statement use a static variable. Then you can make it increment with each hit, and decrement when the powerup hits the bottom(you will still need an array, this just allows you to have more than 5 like in the example).
-
Feb 19th, 2003, 09:23 PM
#5
Fanatic Member
I was just giving an example of how variable arrays could be used in case he didn't know what they were.
Don't pay attention to this signature, it's contradictory.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|