You know
simple pool
Printable View
You know
simple pool
Are you mean those games look like snooker?
:D If you ever manage to make that pool game, please send it to me: [email protected]
I love playing pool ;)
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
Then you'd make an array of Balls of type BallTypeCode: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 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
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.
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
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
Vectors should cover all your needs, momentum can be split up and operated as vector components as well.
Why split it all up when oblique collisions equations can do it all ?
OK sorry, silly me.
I remember now. The oblique collisions equations do actually use vectors to solve them.
- jamie.
The only trouble with DarkBasic is that it's bloody slow!Quote:
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
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.
Can I start advertising things now ? :)
- jamie
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!Quote:
Originally posted by plenderj
Can I start advertising things now ?
:)
I was being sarcastic, not complaining ...
'The only trouble with DarkBasic is that it's bloody slow! '
and full of memory leaks acoording to the posts on the
forum there!