This site requires JavaScript, please enable it in your browser!
Greenfoot back
_kr_696
_kr_696 wrote ...

2020/1/30

Ping Pong Game

_kr_696 _kr_696

2020/1/30

#
need help making the ball bounce off the paddle
danpost danpost

2020/1/31

#
_kr_696 wrote...
need help making the ball bounce off the paddle
Show attempted codes.
_kr_696 _kr_696

2020/1/31

#
well, I got it.
public void act() 
    {   
        movement();

        Actor paddle_1 = getOneIntersectingObject(Bar1.class);
        if (paddle_1!=null)
        { 
            xSpeed = -xSpeed;
        }
        Actor paddle_2 = getOneIntersectingObject(Bar2.class);
        if (paddle_2!=null)
        {  
            xSpeed = -xSpeed;
        }
        
        
        
    }   
_kr_696 _kr_696

2020/1/31

#
now I need help with a score counter
_kr_696 _kr_696

2020/1/31

#
nevermind I haven't gotten to the counter. I need to make the left and right boundaries so the ball disappears, but I don't know how to.
You need to login to post a reply.