Results 1 to 15 of 15

Thread: How do I make a vb POOL table?

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    9
    You know
    simple pool

  2. #2
    PowerPoster Chris's Avatar
    Join Date
    Jan 1999
    Location
    K-PAX
    Posts
    3,238
    Are you mean those games look like snooker?

  3. #3
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    If you ever manage to make that pool game, please send it to me: [email protected]

    I love playing pool
    Jop - validweb.nl

    Alcohol doesn't solve any problems, but then again, neither does milk.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Well, just have a big picture box.
    Use a background of green.
    Draw in borders + pockets.

    Make a UDT for the balls
    Something along the lines of
    Code:
    Private Type BallType
        posX As Long  'X co-ordinate of centre of ball
        posY As Long  'Y co-ordinate of centre of ball
        'more stuff re. colours etc.
    End Type
    Then you'd make an array of Balls of type BallType
    Then draw them onto the screen.

    Then draw a stick.
    If the mousepointer is on screen, have the stick 'pivoted' at some position at the mousepoint position, pointing towards the cue ball.

    When user clicks (or whatever), have the stick move towards the ball.
    When the stick hits the ball (the cords of the end of the stick intersect with the cords of the ball (cords of centre of ball + width of ball)), have the ball move in a direction.

    Then use the formulae from physics for motion with friction, and also for inelastic oblique collisions.

    There would be a lot of trig involved, but its all fairly easy.

    Hope that helps/makes sense

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    In fact, you could avoid most and why not all trigs by using vectors instead Ball to ball collision is almost as easy as ball to wall. the collision is (distance is smaller than cumulative radius) Ball to wall collision is generally done by point to line formula, but for simplication you could just test a single dimension component, x component for vertical walls and y component for horizontal.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Hyperactive Member
    Join Date
    Sep 2000
    Posts
    257
    i don't know if you've heard of it before, but there is something sooooooo much better for making games that VB.
    and the best part is.....you don't have to learn C++, or any other language for that matter, and this wonder language is called "Dark Basic", it's just for directX, but the things you can make with it are unbelievable!
    it's DEFINITELY worth a look.
    http://www.darkbasic.com
    When I write my code, only God and I know what it means. But a week later, only God knows.

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Jesus i dont remember vectors at all from applied maths ... uhn.
    Well, oblique ball to ball collision, are complicated, and I think you'd have to use trig.
    Also, collisions will involve momentum, restitution and some other goodies. I don't think vector math would cover those.

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Vectors should cover all your needs, momentum can be split up and operated as vector components as well.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  9. #9
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Why split it all up when oblique collisions equations can do it all ?
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  10. #10
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    OK sorry, silly me.
    I remember now. The oblique collisions equations do actually use vectors to solve them.

    - jamie.
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  11. #11
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136

    Dark Basic

    Originally posted by BitBlt
    i don't know if you've heard of it before, but there is something sooooooo much better for making games that VB.
    and the best part is.....you don't have to learn C++, or any other language for that matter, and this wonder language is called "Dark Basic", it's just for directX, but the things you can make with it are unbelievable!
    it's DEFINITELY worth a look.
    http://www.darkbasic.com
    The only trouble with DarkBasic is that it's bloody slow!

    I'd recommend http://www.blitzbasic.com if you need fast code.

    It can throw around 15,000 sprites per second - even on a P233. No 3D support as yet, but it's coming. Check the site for more details.
    Visual Basic 6 Enterprise Edition + SP4

  12. #12
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Can I start advertising things now ?

    - jamie
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  13. #13
    Addicted Member
    Join Date
    Apr 2000
    Location
    Sheffield, England.
    Posts
    136

    Cool

    Originally posted by plenderj
    Can I start advertising things now ?
    Yeah it's a blatent advertisement! Can't really see anyone having a problem with that, since Visual Basic is no good for games programming, and Blitz Basic is no good for Windows apps. Because both languages are used for entirely different purposes, people can use and enjoy both!

    Visual Basic 6 Enterprise Edition + SP4

  14. #14
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    I was being sarcastic, not complaining ...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  15. #15
    Guest

    DB

    'The only trouble with DarkBasic is that it's bloody slow! '

    and full of memory leaks acoording to the posts on the
    forum there!







Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width