-
Apr 26th, 2007, 01:11 AM
#1
Thread Starter
Lively Member
colliding graphics
vb Code:
If Ball.VisibleClipBounds.Bottom = Bar.VisibleClipBounds.Top Then
tracker = 500
tracker2 = 500
End If
shouldn't this take care of two objects colliding?? when they DO collide, nothing happens, they go right through each other. there are alot of good method for visible clip bounds, and i have tried alot of them, suggestions would be nice.
Last edited by kylekocak; Apr 26th, 2007 at 01:41 PM.
-
Apr 28th, 2007, 06:44 PM
#2
Lively Member
Re: colliding graphics
Instead of checking if the bottom clip bound is EQUAL to the top of the bar, check if its GREATER THAN OR EQUAL to the top of the bar (or less than, I keep forgetting where VB starts the 0 y value). The chances that the ball is exactly equal to the top of the bar is very very small, you have to check if its greater than or equal.
Try that and if it doesn't work, please post more of the code.
-
Apr 30th, 2007, 02:31 PM
#3
Junior Member
Re: colliding graphics
Try
if(Ball.VisibleClipBounds.Bottom >= Bar.VisibleClipBounds.Top) Then
and then depending on how you do the game you might want to add another if to make sure that it is colliding below also:
if(Ball.VisibleClipBounds.Top <= Bar.VisibleClipBounds.Bottom) Then
-
May 5th, 2007, 03:07 PM
#4
Hyperactive Member
Re: colliding graphics
@kylekocak: Basically you are checking to see if the shapes have the same Y coordinate so they miss each other when you move one quicker the a twip per second.
What are "Tracker" and "Tracker2"? Are they shapes or varibles? if they are shapes why don't you set Tracker.top to 500 and Tracker2.top to 500?
Can you also post some more code so that we can understand what you want to achieve.
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
|