Zoo tutorials: [ SQL | Linux | XML ]
ProgZoo: [ Java | C# | VB | C++ | Perl ]
Log in

A Gentle Introduction to
C++ Programming

Tutorial: Animation

 

1. Lunar Lander I


Big

Try the applet generated by this program. Press the up arrow to slow the descent.

Now try the following changes:

  • Show how much fuel is left by adding the following line to the paintFrame method.
    g.drawString("Fuel: "+fuel,50,10);
  • In the tick method decrement fuel inside the if statement. Use fuel--
How it works

2. Lunar Lander II


Big

3. Lunar Lander II


Big