|
-
Sep 12th, 2001, 04:15 PM
#1
Thread Starter
Fanatic Member
Programming Question
Iam creating a space ship like game in visual basics and I have a line on the bottom of the form where after the user dodges the blocks that once the blocks hits the line the block disappear if anyone has a code please let me know. Please check out my site at http://www.geocities.com/striver2000t/enterprise.html
Walter Richardson
Striver2000 Christian Productions
Iam seventeen but since I started VB in June of 01 GOD has been helping me excell by finding this great forum with a bunch of GREAT PEOPLE!
-
Sep 12th, 2001, 06:39 PM
#2
Frenzied Member
Are you using controls or bitblt in your game?
-
Sep 12th, 2001, 06:47 PM
#3
Addicted Member
I hope you're using an array for enemy fire or obstacles or whatever you have moving past this line
Code:
Private Type EnemyFire
x As Integer
y As Integer
End Type
Dim EnemyFireArray(9) As EnemyFire
With EnemyFireArray(I)
For I = 0 To 9
.y = .y + 5 'moves the gunshots down the screen
If .y > Line1.y Then 'the gunshots are below the line
.y = -20 'above the top of the screen
.x = Int(Rnd * 100) 'random positioning for gunshots
End If
Next I
End With
To understand recursion, one must first understand the concept of recursion.
-
Sep 13th, 2001, 06:40 AM
#4
Retired VBF Adm1nistrator
If the block hits the line just stop drawing it !?
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Sep 13th, 2001, 01:23 PM
#5
Addicted Member
Well, I dont know. It depends on your program :\ If you want the blocks to continously move past the ship, then when it reaches the line, you just change the position that you are painting it at to the top of the screen so it will then scroll down again and again in a continuous loop
To understand recursion, one must first understand the concept of recursion.
-
Sep 14th, 2001, 05:38 PM
#6
Frenzied Member
If you're using controls, it's simple 
VB Code:
If Block.Top > Form1.Height Then Unload Block
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
|