Pong, Make an object move?

Hey Guys
I wanted to programm the game “Pong”. It’s the game with the ball and the two things at the sides. Do you know how i can make an object move and decide its borders?

Hi Alex,

Learn how to use timers and how to use a canvas for the drawing. That’s the basics of what you will need.

The logic of detecting the borders/collisions is something you should figure out on your own. You can always ask for help if you get stuck with something.


@Julen Ibarretxe Uriguen
Hi thx 4 your reply
I know the basics but how can i connect the canvas with the timer? I’ve just got some starting problems… If I more or less know how i’m able to do this it’ll be alright.

@Julen Ibarretxe Uriguen
& do i have to add an Oval in the Canvas?

Hi Alex

This project may give you some insight. Something I was playing with yesterday for fun.


@Wayne Golding
Could you repost the link? can’t open it :frowning:


Wonder what happened there?

@Wayne Golding
thx but there are certain numbers missing…

I was just starting to look at adding a scoreboard. You could just comment out the references to numbers, or get the image from https://dl.dropboxusercontent.com/u/18858366/Numbers.png.

Scoring doesn’t work, the ball is always launched from the same location in the same direction, and speed is constant.

The bit you should be looking at is the timer action event. The key’s I’ve used to control the paddles are a & z on the left & ’ & / on the right.