Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK .NET / Water?

Author
Message
StartCoder
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 13th Dec 2009 20:54
Hi Guys,

How can i make water in my 2d tiled game?. I how to make it with animatedsprites but it makes it slow and i would need many tiles!!. so any tips? Thanx in advance.
VB and GDK
14
Years of Service
User Offline
Joined: 2nd Jun 2009
Location:
Posted: 13th Dec 2009 23:00
Is the water animated.
StartCoder
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 13th Dec 2009 23:06
I dont have any water yet,,, yes i would like to have animated water in my 2d game.. anyway ?
VB and GDK
14
Years of Service
User Offline
Joined: 2nd Jun 2009
Location:
Posted: 14th Dec 2009 01:56
You could start by declearing all the tiles your'll need like this:


Dim water(a) tile as darkgdk.basic2d.sprite
or
Dim water(a) tile as darkgdk.basic2d.animatedsprite


Where the a is the number of tiles. Then when you want to apply the picture just:


water(1) = new darkgdk.basic2d.sprite(sizex,sizey,texture)
or
water(1) = new darkgdk.basic2d.animatedsprite(file,height,width)
StartCoder
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 14th Dec 2009 06:44
VB and GDK thank you for ur reply. But I know that method, i dont want to use it because if you have many animated tiles the game will run slow, So i need beter way to make animated water.
and with tile size of 32x32 animated tiles dont look good.
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 14th Dec 2009 17:21
Make two tile pictures that will look like waves when you do this.

Make two sprites per tile for the water, have your base sprite, and then put your second sprite right over it. Then alpha fade the second one back and forth to expose/cover the first one. It takes more sprites, but it might be faster than a true animation.

OR

You could always use a textured plain as your water and use the same technique as above, or even a shader, especially if your players aren't going to be traveling on the water.

StartCoder
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 14th Dec 2009 20:07
@KISTech,

Thank you for ur idea, I was thinking about the same thing
but do you have any sample of the second part? it sounds interesting.


"You could always use a textured plain as your water and use the same technique as above, or even a shader, especially if your players aren't going to be traveling on the water."
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 15th Dec 2009 01:01
Just set up the textured plain with the water, and then put your land sprites over it. Should be pretty simple.

StartCoder
14
Years of Service
User Offline
Joined: 16th Oct 2009
Location:
Posted: 15th Dec 2009 22:45
Hmm.. i never worked with shaders and textured plain before ( i am new to Gaming and Dark GDK).

So if someone has any sample for me it will be greate help.

Login to post a reply

Server time is: 2024-03-29 05:02:41
Your offset time is: 2024-03-29 05:02:41