Results 1 to 2 of 2

Thread: I need help on this arkanoid game I made.

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    7
    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

  2. #2
    PowerPoster Fox's Avatar
    Join Date
    Jan 2000
    Location
    *afk*
    Posts
    2,088
    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
  •  



Click Here to Expand Forum to Full Width