I am making a Bejeweled game in Visual Basic Professional 2010 (which is apart of the web browser known as Scoontz) and I stumbled across an error when trying to draw a sprite:
DrawSprite is not a member of Scoontz.Sprite
Here is the code (with the line in question in bold):
' Note that this function does NOT update the REAL postion of the cell.
Public Sub DrawCell(ByVal Surface As Graphics, ByVal Cell As Cell, _
Optional ByVal Background As Boolean = True)
' Retrieve the piece
With Pieces(Cell.PieceIndex)
' Draw its background
If Background Then
DrawBackground(Surface, New RectangleF(Cell.Position.X, Cell.Position.Y, _
Cell.Piece.Sprite.Width, Cell.Piece.Sprite.Height))
End If
' Make sure the piece index is valid
If Cell.Visible Then
' Draw the specific sprite onto an caculated area
With .Sprite
.ImageAttributes = Cell.ImageAttributes
.DrawSpirte(Surface, Cell.Position.X + Cell.Offset.X, Cell.Position.Y + Cell.Offset.Y)
End With
End If
End With
End Sub
Note, I was suggested that add a general method to draw the sprite, but when trying to debug the program, it threw an exception error. I need to know how can I fix this error so that the Bejeweled game program can draw sprites.