note about OnDestroy
continuous-integration/drone/push Build is passing Details

main
cosmonaut 2022-03-04 10:50:32 -08:00
parent 67d1d462d1
commit 63c1bc1e52
1 changed files with 9 additions and 0 deletions

View File

@ -32,6 +32,11 @@ namespace MyProject
{
// draw code here
}
public override void OnDestroy()
{
// cleanup code here
}
}
}
```
@ -69,3 +74,7 @@ Rendering code goes here. I recommend structuring your codebase so that your Gam
You might be wondering what `alpha` refers to. What if you set your game to update at 60 frames per second but one of your users has, for example, a 144Hz monitor? This will result in ugly stuttering as the game logic and rendering update out-of-step with each other. `alpha` gets filled in with a value between 0 and 1 which refers to a blending factor between the previous game state and current game state. This will allow you to linearly interpolate your position and rotation values between the two states to eliminate this stuttering.
For a more in-depth explanation of this behavior, I recommend reading the [Fix Your Timestep](https://www.gafferongames.com/post/fix_your_timestep/) article.
### OnDestroy
MoonWorks does its best to keep track of audio and graphics resources you have created to clean them up when the program exits. If you have created additional assets that you need to clean up, you can do that here. Otherwise, it's fine to leave this method blank.