Basketball Question
GingerBGames
Member Posts: 390
Hello GS'ers,
I want to try and make a basketball game, actually a "Knock-out game" with a basketball. I don't know how to do somethings though. I've found some templates on here, but if someone know's of any other ways to accomplish the following, I would greatly appreciate the information.
1.I want to have the basket go from left of screen to the right of screen, and then back again. Possibly more than one basket as well.
2.I will have the basketball on the bottom of the screen(landscape, and only see top half of the ball). I want to have the following happen.
A) When ball is touched, I can drag it left and right to aim the shot
also, when touched, Have a crosshair start in front of the ball go north and south.
The crosshair will move non-stop (N&S) until the ball is released, then the ball will go towards the direction I released it in.
C) When ball collides with actor basket, or missed wall, spawn new ball on the of the screen to start again.
Again, any help would be greatly appreciated.
I want to try and make a basketball game, actually a "Knock-out game" with a basketball. I don't know how to do somethings though. I've found some templates on here, but if someone know's of any other ways to accomplish the following, I would greatly appreciate the information.
1.I want to have the basket go from left of screen to the right of screen, and then back again. Possibly more than one basket as well.
2.I will have the basketball on the bottom of the screen(landscape, and only see top half of the ball). I want to have the following happen.
A) When ball is touched, I can drag it left and right to aim the shot
also, when touched, Have a crosshair start in front of the ball go north and south.
The crosshair will move non-stop (N&S) until the ball is released, then the ball will go towards the direction I released it in.
C) When ball collides with actor basket, or missed wall, spawn new ball on the of the screen to start again.
Again, any help would be greatly appreciated.
Comments
- when actor is touched, constrain self.position.x to device.mouse.position.x Create the actor, put the movement behaviour in it and save (using constrain) its position into a game attribute.
Use "vector to angle" to calculate the angle between the ball and the crosshair and store it into another game attribute.
Put a rule in the ball actor. When is released, accelerate with the angle = vector to angle previously stored. Again... a rule: when ball overlaps with basket spawn new actor. Put the position relative to scene.
Hope that was helpful.
bye