Click here to Skip to main content
13,004,094 members (109,817 online)
Rate this:
Please Sign up or sign in to vote.
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 11-Dec-11 8:19am
Addy Tas 11-Dec-11 14:23pm
Maybe a silly suggestion but what about overwriting the targeted line with the background?

Cheers, AT
tambores63 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
SAKryukov 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.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

While drawing lines specify it's color with alpha value

"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.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170627.1 | Last Updated 3 May 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100