PDA

Click to See Complete Forum and Search --> : Tiles and ****


Taz[bS]
Feb 4th, 2000, 06:11 AM
I want to make a strategy game... But i dont get this **** with using tiles. So if anyone wanna explain please do so.

KENNNY
Feb 5th, 2000, 12:21 AM
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

Arie
Feb 5th, 2000, 11:20 AM
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:
Arie_P14@hotmail.com

Thank you very much. ;)

Taz[bS]
Feb 5th, 2000, 08:21 PM
Well, why dont you try to explain using tiles to me Kennny? Or someone else?
Please? I am desperate! :(


/Taz[bS] :) :(

*Super Sniper*
Feb 6th, 2000, 11:50 AM
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).]

Fox
Feb 6th, 2000, 02:21 PM
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

------------------
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.

space_cadet
Feb 6th, 2000, 08:38 PM
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.

KENNNY
Feb 8th, 2000, 04:39 AM
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

Fox
Feb 8th, 2000, 05:47 AM
(My code is the same technic like space_cadet's)

Hm... I've lovely 200 frames with 24 bit true color, but not fullscreen.

------------------
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.

Taz[bS]
Feb 8th, 2000, 06:35 PM
Hehe, well how'd ya'll learn how to use bitblp? I just need to :(

Fox
Feb 8th, 2000, 10:50 PM
Learning by doing... It's really simple.

I can send you a well-comentated demo project how to using BitBlt, if you want.

Taz[bS]
Feb 9th, 2000, 02:06 AM
Yeah sure, thanx
email to tobbe.dahlqvist@telia.com

:)!

drewski
Feb 11th, 2000, 08:56 AM
Can I get a copy of that demo for bitblt too?


Thanks a lot
Drew

*Super Sniper*
Feb 11th, 2000, 03:29 PM
Can I get a copy too?
e-mail: vbworld.chris@kaynor.net

------------------
Website (http://www.kaynor.net)

drewski
Feb 14th, 2000, 10:15 AM
sorry for not including my address its tenneydrew@hotmail.com

thanks alot
drew

spandex44
Feb 15th, 2000, 01:52 AM
Me too? :)
Thanks.

spandex44
Feb 15th, 2000, 01:52 AM
Me too? :)
Thanks:
gs_enterprises@hotmail.com

Fox
Feb 15th, 2000, 03:28 AM
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/

------------------
fox_mccloud@gmx.net
...
Every program can be reduced to one instruction which doesn't work.

Taz[bS]
Feb 15th, 2000, 03:48 PM
Well, i know see how tiles work, some atleast. Thanks to you Fox and some other pepole.
:) :) :)

Thank you All!

/Taz[bS]

*Super Sniper*
Feb 18th, 2000, 09:03 AM
Who wants to get back to the top?

Cause

<<<!BACK TO THE TOP!>>>

------------------
Website (http://www.kaynor.net)

Mar 1st, 2000, 06:05 AM
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

Fox
Mar 1st, 2000, 06:53 PM
Of course, visit my website:
http://derzirkel.tsx.org

If TSX doesn't work try it directly :
http://members.xoom.com/Der_Zirkel/