Soccer game
Fajlajp
Member Posts: 666
Hi
I´ve been searching for away to make a soccer game that you shoot penalties. But I´ve got problems. Big problems. I have no idea how to do. Could anyone be nice to help me with demo or tell how I will do this. I´ve searched alot but don´t find a good way of doing this.
1- How will I shoot and detect if it´s in the goal.
2-Make an ai for the goal keeper that gets better and better.
Have anyone tried to make a game like this or have a demo laying that could work or any video tutorials of what I´m searching for. Please answer me asap. Thank you
//Fajlajp
I´ve been searching for away to make a soccer game that you shoot penalties. But I´ve got problems. Big problems. I have no idea how to do. Could anyone be nice to help me with demo or tell how I will do this. I´ve searched alot but don´t find a good way of doing this.
1- How will I shoot and detect if it´s in the goal.
2-Make an ai for the goal keeper that gets better and better.
Have anyone tried to make a game like this or have a demo laying that could work or any video tutorials of what I´m searching for. Please answer me asap. Thank you
//Fajlajp
Comments
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Something like this would be great. But if it doesn´t work, I could go with 3d.
https://www.dropbox.com/s/n42n5adg4ih5ips/penaltygogo-game.jpg
Actually the sport that I´ve try to recreate is called team handball. But most of the people haven´t herd about it. It´s just the European people that have herd about it. So i thinked of instead of saying handball I said soccer(it´s the same point) so more could under stand Take a look if you want
It should be entirely possible, using collision rules to detect whether the ball crosses the line, and when the ball is thrown, have the goalie move towards the ball on its axis, and it is this speed that you want to increase in order to increase the difficulty. Also, add some random movement such as diving the wrong way every now an then, and you're away!
Also I don´t the goalkeeper to be totally random. I want it to be better and better when you chooses from easy-expert.
Any idea @iCreationZ
I´ve tried since I first got gamesalad about 3 months ago.
Going by the picture, it's a bit difficult to determine what you're after, will the player be able to select the power of the shot, or just the direction?
If its just the direction, once the shot has been taken, use the change size behaviour (negatively) and a little trick with interpolate to make the ball look like its arcing away from you. Then add a timer, so after however many seconds you want the ball to travel for, which would depend upon the power of the shot, change score to +1 or true or whatever.
And the other problems...
I'd suggest determining how long it will take for the ball to reach the goal.
Lets say, 2 seconds.
Have an actor for the goalie which, after 1 second will move towards the balls position (y), this would mean that the goalie would not have instant reflexes, realistically, and to increase the difficulty, simply change the speed at which the goalie moves towards the ball.
So it´s only left for the cross the line...
After 2 seconds (as in my last example) the ball has crossed the line, so it's at this point that you add rules for changing the score or resetting for another go, etc.
adding to @iCreationZ 's suggestion, you can also try to create a "guessing" AI.
Since it's a penalty shoot out and each shot would be over in a snap, you can try giving the goalie a set of directions to lunge to as its options. Dive left, reach left, stay in center, reach right, dive right -- depends on how wide you want to design your goal.
For example's sake, if you decide on 5 directions you can create a simple table with, say 26 rows. Allot 5 rows for each direction, and initially 1 row for the actual or correct direction which the shot is really going towards. Once the shot is taken immediately fire a rule that randomly chooses 1 row and have the goalie block in that direction. As the game progresses, simply perform an Add Row (correct direction), which increases the likelihood of the goalie blocking a shot.
P.S. I doubt it, but if the Rule takes too long to complete, simply adjust the time it takes for the shot to reach the goal cheap.
That sounds great. Thank you so much. You just gave me an idea of how will do
That's a much better tactic than my tacky, cheap 'n' cheerful AI!
I´ve thinked and remembered that you spoke of 3d. And I will try to do that. Have you any idea how I will let the ball left go of is and, detect if it crosses the goalline and so on.
Thank you for taking the time and helping me
//fajlajp
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User