This is the testing Godot forums! All forum posts unique to this forum will be deleted! Please use the main forums here for any posts you want to keep. All forum rules still apply.

pong tutorial trouble

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 2017

    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.

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.