if image2 cordinates is 1200, 2040 how do you make
that image1 don't walk over image2?
Printable View
if image2 cordinates is 1200, 2040 how do you make
that image1 don't walk over image2?
Hi!
You can write the next conditions:
if image1.left > image2.left and _
image1.top > image2.top and _
image1.top+image1.height < image2.top+image2.height
...
end if
or something like it.
I don't remember exactly.
p.s.
Tell me what style of game you want to do.
Thank you,
Arie. :)
it's a rpg game!
Make it tile-based.
indeed
and write a RECT intersecting function, which can be used for lots of stuff.
ie.
Function InRect(r1 as RECT, r2 as RECT) as boolean
email me if u want code.
how do i make it tile based
First you must have an array of tiles where you store the DCs of your pictures. Next is a map where you store the indexes of the tiles.
Like this:
Hope this helps.Code:Dim A as Long,B as Long
Dim Tile() as Long
Dim Map() as Long
'Load some tiles
ReDim Tile(2)
Tile(0) = Picture1.hDC
Tile(1) = Picture2.hDC
'Randomize map
ReDim Map(10,20)
For A = 0 to 10
For B = 0 to 20
Map(A,B)= 1 * Rnd
Next
Next
Wow, now we can indent the code :cool:
awww baad :)
Code:Function LookICanIndent(At Least I Hope so)
er this isnt working..