I want to make a strategy game... But i dont get this **** with using tiles. So if anyone wanna explain please do so.
Printable View
I want to make a strategy game... But i dont get this **** with using tiles. So if anyone wanna explain please do so.
I'm making a strategy game too. i've just figured out how to make tiles work.. its tricky cos you have to take scrolling into account, etc.
Im still working on getting scrolling fully working.. for some reason my textures seem to just squash up when i scroll :(
just try coding something simple to see how they work.. they can work :)
------------------
cintel rules :p
www.cintelsoftware.co.uk
Hi!
This is one of my big problems in VB.
I don't know how to do this either. :(
If you please send me the answer for that
from someone so send it to:
[email protected]
Thank you very much. ;)
Well, why dont you try to explain using tiles to me Kennny? Or someone else?
Please? I am desperate! :(
/Taz[bS] :) :(
With it squashing up the textures try using a (form).cls and redraw it. I don't know if you already tryed it but I would like to know how to do something like that to. :confused:
[This message has been edited by *Super Sniper* (edited 02-07-2000).]
OK guys,
I'm making a RPG and I know something ybout tiles (I'm using BitBlt, but doesn't matter how to draw them).
Well, my tiles are stored in DCs and I've got a 'map' array of indexes. I think that's what you have too. Make them scroll is a bit difficult, depending how you're storing the map array. I've taken a 1D array so I can resize it while it's running, but like I said that's a bit harder to make. With a 2D map you can easy calculate the positions, best will be to make a camera object or just 2 coordinates like CameraX and CameraY. By drawing the scene you have to include this coordinates to know what to draw and where to draw. Look at this example code:
-
Dim A as long, B as long
Dim TempX as single, TempY as single
'Calculate precise map coordinates
TempX = Camera.x / TileWidth
TempY = Camera.y / TileHeight
For B = 0 to (Form1.Height / TileHeight)
For A = 0 to (Form1.Width / TileWidth)
DrawTile (A - (TempX - Int(TempX))) * TileWidth, (B - (TempY - Int(TempY))) * TileHeight, Tile(Map(int(TempX) + A, int(TempY) + B)).DC
Next
Next
-
I hope you can understand what I wrote ;). If not you can download my game at my website and take a look of it's code...
Fox
------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.
I personally store all the Images in DC, then have a 2d array to store which tile goes where. Then I use a viewport, somthing similar to:
type viewport
x as int
y as int
w as int
h as int
end type
To do the scrolling, all I do is move the view port around the 2d array, then you redrawn what is contained within the viewport. Easy.
I do the same thing as space cadet, sort of. Anyway, I've got it working now, perfectly :)
lovely 75 fps with DX7 - in fullscreen
------------------
cintel rules :p
www.cintelsoftware.co.uk
(My code is the same technic like space_cadet's)
Hm... I've lovely 200 frames with 24 bit true color, but not fullscreen.
------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.
Hehe, well how'd ya'll learn how to use bitblp? I just need to :(
Learning by doing... It's really simple.
I can send you a well-comentated demo project how to using BitBlt, if you want.
Yeah sure, thanx
email to [email protected]
:)!
Can I get a copy of that demo for bitblt too?
Thanks a lot
Drew
Can I get a copy too?
e-mail: [email protected]
------------------
Website
sorry for not including my address its [email protected]
thanks alot
drew
Me too? :)
Thanks.
Me too? :)
Thanks:
[email protected]
Of course, I sent it to all of you. If you need a more complex example you can also download a demo game engine from my website.
http://derzirkel.tsx.org
If TSX doesn't work try it directly :cool::
http://members.xoom.com/Der_Zirkel/
------------------
[email protected]
...
Every program can be reduced to one instruction which doesn't work.
Well, i know see how tiles work, some atleast. Thanks to you Fox and some other pepole.
:) :) :)
Thank you All!
/Taz[bS]
Who wants to get back to the top?
Cause
<<<!BACK TO THE TOP!>>>
------------------
Website
Yo, fox can I get a copy of the program too? It would really help me out. Also, anyone, do you know of any good newbie tutorials for someone just starting DirectX????
Thanks
~~~~~~~~~~~~~~~~~~~~
The Monkeys fly at midnight
AGbsa84
Of course, visit my website:
http://derzirkel.tsx.org
If TSX doesn't work try it directly :
http://members.xoom.com/Der_Zirkel/