Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: sameera on Thu 21/09/2006 12:58:31

Title: Can anyone come up with an idea how to bat and ball in a cricket game in AGS
Post by: sameera on Thu 21/09/2006 12:58:31
Hello Everyone,

I'm currently making a cricket game. I got a small problem. I have decided to make my game like this. Below is basically what I have decided to do.

* The person clicks the "BALL" hotspot
* The bowler animation
* Appear object
*Object move (Wait till move finish False)
*If the batsman uses the interact cursor on the object the shot animation would

Here is something to help you guys

(http://img242.imageshack.us/img242/5467/sdasdsadkr7.png)

Now you can see that your efforts to answer this question is not a waste of time.

If my suggestion is not practical can anyone come up with an idea to ball and bat
Title: Re: Cricket game moving object help
Post by: monkey0506 on Thu 21/09/2006 22:06:46
It would be very useful if we could see what code you're currently using. And welcome to the forums. ;D

[EDIT:]

You created a thread earlier here (http://www.adventuregamestudio.co.uk/yabb/index.php?topic=28443.0) about this same problem. You're not supposed to create multiple threads for the same problem, but since I already replied here, I won't reply to the other one. And no...I'm not a mod, so I'm not suppose to do what I'm doing right now. :D
Title: Re: Cricket game moving object help
Post by: sameera on Fri 22/09/2006 03:08:54
I edited my first post
Title: Re: Can anyone come up with an idea how to bat and ball in a cricket game in AGS
Post by: monkey0506 on Fri 22/09/2006 06:06:00
I'm not entirely sure what you want...but then...I'm not entirely sure how cricket is played. :=

From what I understand, you want the user to click on "BALL", run the animation of the ball being thrown, then turn on the object which has the ball's picture on it, and if the user clicks on that object, it plays the swinging animation, and if they clicked it at the right time they will hit the ball?

That could be complicated. But do you have any code at all so far or just the idea?
Title: Re: Can anyone come up with an idea how to bat and ball in a cricket game in AGS
Post by: R4L on Fri 22/09/2006 18:28:10
If it is something like monkey said then couldn't you do this:

1) Create a varible called distance and its value could be 500
2) As the object moves, you could subtract from distance every game loop
3) Call a If statement= if ((distance < 50) && (distance >30)){
Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, //code here}
4) Call another If statement for strike= if (distance < 30) {
                                                              //code here}


Not sure if something like that would work, but you could try something like it.

Title: Re: Can anyone come up with an idea how to bat and ball in a cricket game in AGS
Post by: SilverWizard_OTF on Sun 24/09/2006 11:04:46
Could you tell us cricket's rules; This will help us to realise exactly what you want to do :)
Title: Re: Can anyone come up with an idea how to bat and ball in a cricket game in AGS
Post by: Ashen on Sun 24/09/2006 11:10:12
Since sameera has released a cricket game (http://americangirlscouts.org/bbc.com/yabb/index.php?topic=28461.0), I'm guessing this is solved.
sameera: If so, can you update the topic in the first post accordingly? Thank you.