|
-
Mar 24th, 2000, 01:32 AM
#1
Thread Starter
New Member
I have made a arkanoid game and I am getting an error on one section of the code.
It follows here below.
When I try to run it, it says:
Compile Error:
Only public user defined types defined in public object modules can be used as parameters or return types for public procedures of class modules or as fields of public user defined types.
Function Collided(A As tBitMap, B As tBitMap) As Integer
'-------------------------------------------------
' Check if the two rectangles (bitmaps) intersect,
' using the IntersectRect API call.
'-------------------------------------------------
' Although we won't use it, we need a result
' rectangle to pass to the API routine.
Dim ResultRect As tBitMap
' Calculate the right and bottoms of rectangles needed by the API call.
A.Right = A.Left + A.Width - 1
A.Bottom = A.Top + A.Height - 1
B.Right = B.Left + B.Width - 1
B.Bottom = B.Top + B.Height - 1
' IntersectRect will only return 0 (false) if the
' two rectangles do NOT intersect.
Collided = IntersectRect(ResultRect, A, B)
End Function
In the GAMESTUF.BAS The tBitMap data type is defined like this:
Type tBitMap
Left As Integer
Top As Integer
Right As Integer
Bottom As Integer
Width As Integer
Height As Integer
End Type
Please help me!!!!
I am getting very mad because it won't work!!
Thanks
Vern
-
Mar 24th, 2000, 04:30 AM
#2
PowerPoster
Where do you declare the tBitmap type? You have to declare it in a public module. I don't know what you really did... maybe you post some more code if you have no idea what's wrong..?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|