Sign in to follow this  

Generating a wave

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, I am writing a game named as colorwar. I want to create a wave that will gradually spread a particular color over a rectangular grid. can anybody suggest me how to create a this animation. thank you, Pallavi

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Use a regular flood-filler to prefill the cells.

Tag the cells with numbers that increas as distance from the start-point or the nearest already filled cell increases.

For the wave-animation:

Decrement all tag-numbers in a loop, display the cells where the tag-number reaches 0 with the filled color.

Stop iteration if all cells are counted down to 0.

Hope that helps.

Share this post


Link to post
Share on other sites
Thanks. Now i have implemented the code to fill the color of tiles and tag them with the number as it increases from the start or already filled tiles.
For the wave-animation:
Decrement all tag-numbers in a loop, display the cells where the tag-number reaches 0 with the filled color.

But to create a animation for the wave, This idea is not working for 30 fps. It too slow and sometimes hand up. Ooopps !! I am stuck here. can anybody will help me to animate this like a wave.

thanks you,
Pallavi

Share this post


Link to post
Share on other sites

This topic is 4837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this