pong tutorial trouble

lazerbladelazerblade Posts: 1Member

so I'm working through the tutorial, I have the pong up and running, paddles move fine, but the ball just sits there. How do I set it off moving, or what did I do wrong? xD

Answers

  • RossRoss Posts: 199Member

    Nice, the tutorial kind of skips that part doesn't it. However, about one page up from the bottom there's a little bit about restarting the game if the ball goes out of the screen. With this code:

    # Check gameover
    if (ball_pos.x < 0 or ball_pos.x > screen_size.x):
        ball_pos = screen_size*0.5
        ball_speed = INITIAL_BALL_SPEED
        direction = Vector2(-1, 0)
    

    So you should probably put that stuff (after the if line) into a restart() function and call it on ready() as well.

  • AurodenAuroden Posts: 1Member
    edited February 9

    Hello!
    By simply double checking your code for the ball you should discover what's wrong.
    By the way, nobody can see what you don't show so nobody can help you if you don't provide any useful information.

    Edit: sorry, I originally posted yesterday but it got delayed because of approval waiting for membership.

Sign In or Register to comment.