Created
September 3, 2017 13:47
-
-
Save Odonno/d1ae6b2897615b4e7e14fee841f23204 to your computer and use it in GitHub Desktop.
Example of MonoGame Update method updating ViewModel data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected override void Update(GameTime gameTime) | |
{ | |
// add points if a projectile is out of screen | |
foreach (var activeProjectile in activeProjectiles) | |
{ | |
if (activeProjectile.Position.Y > ScreenHeight) | |
{ | |
ScoreViewModel.Instance.BallPoints++; | |
activeProjectile.Deactivate(); | |
} | |
} | |
base.Update(gameTime); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment