|
-
Feb 2nd, 2000, 02:21 PM
#1
Thread Starter
Addicted Member
I think I've go a pretty good grasp on bitblt but I don't know how to make a map like for an rpg bigger than the drawing area and make it scroll.Any help here would be appreciated.
Thank you,
drewski
-
Feb 2nd, 2000, 07:18 PM
#2
PowerPoster
-
Feb 3rd, 2000, 04:30 AM
#3
Hyperactive Member
-
Feb 3rd, 2000, 07:09 AM
#4
PowerPoster
[What the heck is a RTS ]
There's not much to say about the class itselfs, there are 2 vars (x as single, y as single) and a function LookAt(x as single, y as single).
The code you want (I think) is in the Draw -function. I don't know if you can understand THIS, but I hope so. Look at my draw code:
(Note that my map array is 1-dimensional!)
-
Public Sub Draw()
On Error Resume Next 'Only for the demo
Dim A As Long
Dim B As Long
Dim Index As Long
Dim TempX As Single
Dim TempY As Single
TempX = (Camera.X / TileW)
TempY = (Camera.Y / TileH)
'Draw map
For B = 0 To Viewport.TilesY
Index = Int(B + TempY) * Level(AktLevel).w + Int(TempX)
For A = 0 To Viewport.TilesX
BitBlt Viewport.BackDC, (A - (TempX - Int(TempX))) * TileW, (B - (TempY - Int(TempY))) * TileH, TileW, TileH, Tile(Level(AktLevel).Map(Index).Layer(0)).DC, Tile(Level(AktLevel).Map(Index).Layer(0)).SrcX + Tile(Level(AktLevel).Map(Index).Layer(0)).Ani.Akt * TileW, Tile(Level(AktLevel).Map(Index).Layer(0)).SrcY, vbSrcCopy
Index = Index + 1
Next
Next
End Sub
-
Well, it's a bit different to draw a 1D-map but I have no more code for 2D maps...
You can also download the whole sample project from our website ( And don't steel my code ).
-
Feb 3rd, 2000, 07:10 AM
#5
PowerPoster
Hm, you meant Real Time Simulation?
-
Feb 3rd, 2000, 02:18 PM
#6
Thread Starter
Addicted Member
Thanks for the help Fox. Now I just have to sit down for a while nad try to decipher what you wrote Hopefully it'll clear things up.
-
Feb 3rd, 2000, 09:10 PM
#7
PowerPoster
Good Luck!
Note that it's just the draw function, you cxan download the whole project if you don't understand something like 'Tile(Level(AktLevel).Map(Index).Layer(0)).DC'. I know that it's a bit complex, but it's real code from my game...
-
Feb 5th, 2000, 01:39 AM
#8
Hyperactive Member
-
Feb 6th, 2000, 03:25 PM
#9
PowerPoster
-
Feb 8th, 2000, 05:30 AM
#10
Hyperactive Member
-
Feb 8th, 2000, 05:37 AM
#11
PowerPoster
Masks are no problem (wrote a little program). But you don't have to set or include anything for Blitting. Just copy the one line API code and let's go...
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
|