Skip to content

Instantly share code, notes, and snippets.

@Odonno
Created September 3, 2017 13:47
Show Gist options
  • Save Odonno/d1ae6b2897615b4e7e14fee841f23204 to your computer and use it in GitHub Desktop.
Save Odonno/d1ae6b2897615b4e7e14fee841f23204 to your computer and use it in GitHub Desktop.
Example of MonoGame Update method updating ViewModel data
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