Help Needed! viewportRect.Contains error

Oct 18, 2009 at 3:20 AM
Edited Oct 18, 2009 at 3:26 AM

Please help!

 

I get 4 of these errors. I am using Visual Studio 2008.

 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?

[There's also 2 errors for resetElapsedTime. Same error as above only exception is it says SilverArcade.SilverSprite.Game.]

(I am a complete novice and have no knowledge of game programming whatsoever.)

Thanks.

Coordinator
Oct 18, 2009 at 1:45 PM

We're always getting a little closer to supporting all of the methods in the framework (there are a lot of them) and this is one that was not implemented. The version in the source code tree has this method in it, so you can use that version until we have a new release ready. I'm shooting to have the next release around mid-november.