public int CompareTo(GameObject other) { //TODO moc narocny na 60xS SpriteObject th = this as SpriteObject; SpriteObject ot = other as SpriteObject; if (th != null && ot != null) { return((int)(th.Position.Y - ot.Position.Y)); } if (th != null || ot != null) { return(th != null ? 1 : -1); } return(0); }
public void Draw(GameTime gameTime, SpriteBatch spriteBatch, Rectangle view) { int i = 0; while (_objekty.Length > i && _objekty[i] != null) { if (_objekty[i] is SpriteObject) { SpriteObject so = (SpriteObject)_objekty[i]; if (view.Intersects(so.BoundingBox)) { so.Draw(gameTime, spriteBatch); } } i++; } }