Saturday, November 12, 2011

Some Flamethrowing goodness!

I just wanted to post a video and picture of the enemies, and the flame-thrower I added in action.

In the SmashPcWeapons.xml, I added this:
<FlameThrower> <Image>flame.png</Image> <Velocity>500</Velocity> <Damage>6</Damage> <Refire>10</Refire> <TimeToLive>700</TimeToLive> <Fadeout>Yes</Fadeout> <DegreesOff>10</DegreesOff> <ContinuousSound>Yes</ContinuousSound> </FlameThrower>

Fadeout means I want the bullet to fadeout during it's time to live.  DegreesOff means I want it to fire at a random angle of 10 degrees off the straight angle.
And, I had to modify SmashPcBullet.cpp to handle these changes:

In SmashPcBullet Constructor, I added this:
// If this gun shoots off a bit, modify the directions if (BulletDetails.u32DegreesOff) { cpFloat RandomDegrees = (cpFloat)(((S32)rand() % (S32)BulletDetails.u32DegreesOff) - (S32)BulletDetails.u32DegreesOff/2); mpBody->a += RandomDegrees*(PI/180.0f); mpBody->v.x=cos( mpBody->a)*BulletDetails.Speed; mpBody->v.y=sin( mpBody->a)*BulletDetails.Speed; }

And, in the SmashPcDraw(), I added this check:
if (mbFadeout) { U32 u32TimeDiff = (timeGetTime() - mu32StartTime)+1; GlowColor.a = 255 - ((255*u32TimeDiff)/mu32TimeToLive); // Change glow color to just alpha and make fade GlowColor.r = 0; } PhysicalObject::Draw(PlayerLoc, GlowColor);

Anyway, here's the picture and video!


1 comment:

  1. If you love บาคาร่า shopping,Kensington cannot disappoint.No matter what your age group is or what your shopping tastes maybe,Kensington has something always บาคาร่าออนไลน์ ready for everyone.