Programming Course for Beginners - ZedLX

The Easiest Online Computer Programming Course, for Free

Time and Animation [7/9]

Instead of making the arrow keys change ball's position, this program makes them change ball's velocity.

The variables vx and vy were introduced in a single statement. This syntax is allowed in ZedLX and most other programming languages.

The variables vx and vy together make a motion vector. The motion vector determines the velocity of the ball.

Don't lose the ball out off the screen!

After running and studying the program, change it so that variables x and y are introduced in a single statement, just like variables vx and vy.

After running the program, add a variable named acceleration with an initial value 300 at the beginning of the source code. Then use this variable in all the four required places where the number 300 occurs.

After running the program, change the initial value of variable acceleration to some other value. Try out values 50, 600 and 100.

Loading...