>From: Thomas Hruska <[EMAIL PROTECTED]>
>Reply-To: [email protected]
>To: [email protected]
>Subject: Re: [c-prog] asteroids explosion vector graphics
>Date: Mon, 02 Apr 2007 12:14:50 -0400
>
>GLOGIC 20 wrote:
> > hi its in 2d..
> > this is what i have at the moment and it will do the job i suppose.
> > Basically when a collsion occurs startexplosion is called to initialize 
>the
> > values needed, such as the position of the ship and random directions to
> > move in, live span of each particle. each time updateexplosion is called
> > from a timer it moves each bit in the velocity it has and decrements the
> > live of the particle.
> > any ideas of how to improve it? or a better way to tackle it even?
> > oh and any idea how to stretch an image to set as background of the 
>form?
> > thanks
> > gav
>
>One way to improve it is to decrease the velocity exponentially.  Think
>about it:  Explosive debris is thrown from the ship at some velocity but
>that velocity is going to change over the lifetime of the object because
>the explosive force dissipates as you move further away and things like
>friction and gravity come into play to slow the object down.
>
>Downside to doing this is you'll have to use more particles and bigger
>velocities and you'll be recalculating the velocity every iteration
>(i.e. more CPU).  Upside is you get more realism.  And every gamer I
>know loves a satisfying explosion.
>
>Another option to explore is multiple explosions.  Perhaps a few smaller
>ones at different points along the ship and then a big one.  Consider
>using a variety of colors.  You're using green explosions...an odd color
>choice, but try variations of a few surrounding hues for each particle.
>   It'll make the explosion more lively.  Also, consider varying the size
>of each particle at little - put a small filled circle at the end of the
>explosion and make it slightly brighter than its tail.
>
>As to the implementation, it is decent (I don't think it is
>complete/working, though).  newpos should probably be moved to the code,
>though, to save structure space and potentially improve performance.
>Not that you've got a performance issue, but particle engines can chew
>lots of CPU/GPU cycles.
>
>Consider letting a GPU handle your particle engine's drawing operations.
>   2D is just a special case of 3D.  There are several 2D games made
>using a 3D engine.  GPUs are designed for this sort of thing.  That way
>you can worry about the physics of the explosion and not how it is drawn
>on the screen - let the GPU worry about that.
>


Thanks Thomas
Good idea about decreasing the velocity exponentially! will work on that 
next cheers.
also the green colour is just in there while im woking on it coz i wanted to 
be able to differentiate from some of the other objects in the game. will 
mix up the colours when im happy with the spread of the explosion.
afraid i dont know how to work with GPU's yet only being programming couple 
of months
and ill move newpos aswell thanks again
do u have any idea how i can place an image onto the form so that it fills 
the full surface of the form? as in stretch to fit?
Gav

>--
>Thomas Hruska
>CubicleSoft President
>Ph: 517-803-4197
>
>*NEW* VerifyMyPC 2.4
>Change tracking and management tool.
>Reduce tech. support times from 2 hours to 5 minutes.
>
>http://www.CubicleSoft.com/VerifyMyPC/
>

_________________________________________________________________
5.5%* 30 year fixed mortgage rate. Good credit refinance. Up to 5 free 
quotes - *Terms 
https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5d&s=4056&p=5117&disc=y&vers=910

Reply via email to