Score for game pong

Discussion in 'Programming' started by Isa, Oct 1, 2019.

  1. Isa

    Isa Member

    Aug 31, 2019
    I am making the game Pong and when there is a collision with one of my paddles, the score has to be +1
    Does someone the code for doing this?
    I already made a controller for the score but what code does I have to make??
  2. FrostyCat

    FrostyCat Member

    Jun 26, 2016
    Is it normal these days for tutorials to not even teach how to add into a variable or handle them in general?

    Assume that the controller is called obj_controller, and you set up its variables like this:
    pointsA = 0;
    pointsB = 0;
    Then you do this in the paddle's collision with the ball:
    obj_controller.pointsB += 1;

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice