Basketball Question

GingerBGamesGingerBGames Member Posts: 390
edited November -1 in Working with GS (Mac)
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
B) 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

  • GingerBGamesGingerBGames Member Posts: 390
    GingerBGames said:
    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(portrait, 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
    B) 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.

  • mediagraficamediagrafica Member Posts: 12
    GingerBGames said:
    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.

    Use the move behaviour and put some rules releated to the x position of the basket. Otherwise, be more specific. I'm not sure I got it....

    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

    Put a rule on the ball:
    - when actor is touched, constrain self.position.x to device.mouse.position.x

    B) 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.

    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.
    C) When ball collides with actor basket, or missed wall, spawn new ball on the of the screen to start again.

    Again... a rule: when ball overlaps with basket spawn new actor. Put the position relative to scene.

    Hope that was helpful.

    bye
Sign In or Register to comment.