Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i build a game that a ball fly in window and when hit the lines , the lines will Disappear and so on .. how i can do this ??
Posted
Comments
Addy Tas 11-Dec-11 14:23pm    
Maybe a silly suggestion but what about overwriting the targeted line with the background?

Cheers, AT
[no name] 11-Dec-11 16:35pm    
Not really a good idea in OpenGL
Addy Tas 11-Dec-11 16:48pm    
No idea why the hell i even sugested such a thing when i'm fully aware that you can remove the lines or even make them runaway from the ball. I guess it really is time to call it for today.
Sorry guys; sudden stroke of blondness.
Signing off for today, AT
Sergey Alexandrovich Kryukov 11-Dec-11 19:25pm    
Of course the initial suggestion would not work, tambores63 is right, but I think deletion of the lines if artificial problem. The question is not quite clear, though. If the line is simply blocked from view, it should not be removed, if this is a part of action, the object representing the line should be hidden or simply removed.
--SA

1 solution

While drawing lines specify it's color with alpha value
glColor4f(R,B,G,A)

"A" means alpha value and define the transparency ,if it is equal to 1 then complete Opaque and if 0 then complete transparent.
By changing the alpha value of lines,your problem will be solve.
After collision make alpha value equal to 0 then it will be transparent and seems like disappear.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900