Jump to content
  • Advertisement
Sign in to follow this  
Nether

How to code a Shockwave Effect

This topic is 4109 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

There are various points in my game where it would look cool to have a shockwave. (Like when a building blows up) So right now, I just have: g.setColor(shockWaveColor) g.drawOval(x-radius,y-radius,2*radius,2*radius) where the radius is increasing from '0' and it looks crappy. Can someone describe to me, or link to me, a method of coding a cool looking shockwave? Thanks

Share this post


Link to post
Share on other sites
Advertisement
One fairly easy method is to just draw a single textured quad, which expands over time. You can also color it to be a specific color in-game. The most important part is that you get a texture that shows a circular shape, with some noise and texture in it so that it actually looks interesting.

You can also add particle effects and what have you, to spice things up.

Share this post


Link to post
Share on other sites
My game is in 2D and I'm using Java. I'm not really sure how I would texture a quad or even create it.

Share this post


Link to post
Share on other sites
Draw a shockwave in a paint program and draw that picture in your game.

That will probably need transparency/alpha blending and maybe scaling, though.

Share this post


Link to post
Share on other sites
I want to do it with code instead of an image, because in image would cost a lot of cpu power to scale.

Share this post


Link to post
Share on other sites
I'm not so sure that a single textured quad would look terribly convincing, but it would certainly be much faster than rendering a sphere, provided you're taking advantage of 3D hardware.

Admiral

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!