Now, we can specialize RealTimeGame
instead of using subclasses of Game
. This requires a small change to the code. We have to override the UpdateWithTime
method instead of overriding the Update
method. Besides, we have to remove the line base.Update()
; used in the Update
method. These changes will allow us to animate 3D characters taking into account the elapsed time.
1. Stay in the
3DInvadersSilverlight
project.2. Open
InvadersGame.cs
.3. Replace the declaration for the
InvadersGame
class with this one. (Now, it will be a subclass ofRealTimeGame
.):public class InvadersGame : RealTimeGame
4. Replace the declaration of the
Update
method with the following. (Now, we override theUpdateWithTime
method instead.):public override void UpdateWithTime()
5. Remove or comment the following line of code in this method:
//base.Update();
6. Build and run the solution. The application will run as in the previous examples. You will not notice any changes...