diff --git a/egp_story/Player.cs b/egp_story/Player.cs index cfb9fff..b69c1e4 100644 --- a/egp_story/Player.cs +++ b/egp_story/Player.cs @@ -191,13 +191,19 @@ public void Update( LevelMap levelMap, GameTime gameTime ) for ( int i = 0; i < tmpArray.Length; ++i ) { Projectile projectile = tmpArray[i]; projectile.Animation.Update( gameTime ); - projectile.Position += projectile.Velocity * 5; + Rectangle projectileBox = projectile.Animation.FrameBoundingBox; + projectileBox.Offset( ( int ) projectile.Position.X, ( int ) projectile.Position.Y ); + if ( !levelMap.Mask.Bounds.Contains( ref projectile.Position ) ) { // remove this _projectilesShot.Dequeue( ); } + else if ( !levelMap.CheckRectangleBounds( projectileBox ) ) { + //TODO: add hit animation + _projectilesShot.Dequeue( ); + } } }