Skip to main content
Home Forums Silverlight Programming Game Development Possible missing reference error.
1 replies. Latest Post by mchlSync on October 17, 2009.
(0)
Spl33n M...
Member
1 points
5 Posts
10-17-2009 2:28 AM |
I get 4 of these errors.
Error 5 'SilverArcade.SilverSprite.Rectangle' does not contain a definition for 'Contains' and no extension method 'Contains' accepting a first argument of type 'SilverArcade.SilverSprite.Rectangle' could be found (are you missing a using directive or an assembly reference?)
if public void UpdateCannonBalls()
{
foreach (GameObject ball in cannonballs)
if (ball.alive)
ball.position += ball.velocity;
if (!viewportRect.Contains(new Point
((int)ball.position.X, (int)ball.position.Y)))
ball.alive = false; continue;
}
What reference do I add? Or what do I need to add to make it work?
Theres also 2 errors for resetElapsedTime.
Same error as above only exception is it says SilverArcade.SilverSprite.Rectangle.
(I am a complete novice and have no knowledge of Silverlight whatsoever.)
Thanks.
mchlsync
Star
14606 points
2,730 Posts
10-17-2009 3:02 AM |
Spl33n Master: if (!viewportRect.Contains(new Point((int)ball.position.X, (int)ball.position.Y)))
if (!viewportRect.Contains(new Point((int)ball.position.X, (int)ball.position.Y)))
Maybe, You can try using Any or Where instead of Contains.
Example:
if(!viewportRect.Any( item => (item.positin.X == ball.position.X) && (item.positin.Y == ball.position.Y)))