Billiards

Talk about making games.

Billiards

Postby DilloDude » Sat Feb 04, 2006 1:10 am

I am making a simple billiards game. I have a problem. The way billiards works, you have to sink the 9Ball, but you have to hit the ball with the lowest number first. Now, there are two ways I could have this:
A. I could leave it to the players' judgment, but I would need to be able to reset to how it was before the player shoots the ball.
B. I could have the game decide, but I would need to know what ball was hit first, what ball had to be hit first, and if they were not the same, reset to how it was before you shot and change a variable (whiteFollowMouse) to 1.
So either way, I need to reset to the state before the shot and preferably set whiteFollowMouse to 1. I can send a link to a .zip file with the .ged file and the data folder and .exe file. basically, move the target ball which follows the mouse and left-click to fire the ball. When the whiteFollowMouse variable is 1,(currently when the white ball gets sunk) it will follow the mouse until you drop it with right-click.
Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby DilloDude » Sat Feb 04, 2006 1:15 am

Image
User avatar
DilloDude
 
Posts: 866
Joined: Tue Jan 24, 2006 9:51 am
Location: Nyerellion
Score: 58 Give a positive score

Postby Novice » Sat Feb 04, 2006 11:43 am

1.If you want to reset it to a postition before the player shoots make an integer array that will hold the x and y cordinates of all the balls, and then fill the array on mouse button down. I suggest you make the white ball shot on mouse up so there wouldnt be any confusion.
2.To check if the correct ball was hit create two integer vars one that will hold the number of the ball that should be hit and in the other the ball that was hit. To get the ball you hit use a script for every ball like on collision BallHit=1. Then compare BallHit and TargetBall if they are not the same create a few second timer (not neccesary but it will look nicer) and when it counts down (in options make it reacure only once) reset the balls positions with a code something like this:
Code: Select all
Ball1.x=BallPositionArray[0]
Ball1.y=BallPositionArray[1]
Ball2.x=BallPositionArray[2]
...

Hope it helps.
Why do i always get stuck?
User avatar
Novice
 
Posts: 399
Joined: Mon Aug 29, 2005 10:54 am
Location: Relative
Score: 5 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest