Friday, July 31, 2009

How Do you use Visual Basic And make games?

I am trying to make a game like frozen bubbles, but I am not sure how to shoot the bubbles and the bar to come down and make more bubbles that could not be popped?





Care to help?

How Do you use Visual Basic And make games?
To make a algorithm to shoot the bubbles only needed little high school physic. You'd have to convert the angle of the cannon into its gradient, use a tan(gent) function. (VB6: gradient = Tan(angle), VB.NET: gradient = Math.Tan(angle)). Then move the bubble vertically as much as the gradient (VB6: bubble.y = bubble.y + gradient, VB.NET: bubble.y += gradient) while moving horizontally by 1 (bubble.x = bubble.x + 1, VB.NET: bubble.x += 1). [Note, this would work, although the bubble speed would be uneven at different angles, but it could work for now, later you could slowly work out angle-independent controlled speed bubble function]. At each iteration, the bubble would be checked whether it would bump into something (other bubbles, walls, etc) if it bumps into walls, the horizontal direction of the bubble is reversed; if it bumps into other bubbles, it would be positioned on the closest bubble cell.





To make the bar comes down, all the bubble would goes down by one cell height (one bubble height)





Make bubbles that can't be popped, just check if the bubble's property is unpoppable, that means don't pop.
Reply:contact me if you have any question still, or if you need coding help. Report It


flower bouquet

No comments:

Post a Comment