The Daily Click ::. Forums ::. Klik Coding Help ::. Loot Shoot
 

Post Reply  Post Oekaki 
 

Posted By Message

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
3rd January, 2006 at 03:04:24 -

How would i go about coding prizes realisticly (or close enough) exploding from a creature or chest?
They dont want to fall far from the creature/chest but i dont want them to just appear cause that sucks!

Im making an RPG with a real time battle system and this would really top it off. My codings ok (not great ) and this is causing me some serious head aches.

If you help me i will give you large amounts of credit plus my ever lasting respect and admiration!

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
3rd January, 2006 at 03:13:30 -

Well, if you're trying to do what I think you're doing, you'll need a bunch of particles. It doesn't matter if things just appear and dissapear as long as they do so in a pleasing way. Sound (a little snap/popping sound to accompany the sudden appearance) can do wonders as well.

Really, it depends on how everything else works. You say realistically, but things don't just fall out of slain animals irl. But if you just want the effect to work nicely, try something like this:

-A chest is minding its own business
-The chest is struck, and this is accompanied by the sound of [wood splintering, but especially the sharp cracking because that's an easy way for things to appear without being disruptive]
-It fragments into bits of wood that scatter, and simultaneously the item appears from its center
-The item bounces momentarily
-The wood fragments flash or fade and vanish

That would look fine in practice, but like I say it depends on the style of the game as a whole.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
3rd January, 2006 at 03:32:09 -

its not quite what i meant but what you said was very useful for the FX side of it. What i meant was the chest is destroyed then coins, potions etc is thrown from the chest. The animation i have done, its the code for the flying and bouncing items thats causeing me trouble.

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
3rd January, 2006 at 03:50:25 -

I'd use a basic 360 movement engine, but also give each item an alterable value that acts as a Y offset, and another to act as velocity (set this initially to some large number, or better, a random value from a range starting at 50% of the (arbitrary) maximum).
Have them scatter out in a random direction at the speed indicated by the valocity value. You can decrease this regularly as it moves, maybe experiment with it decreasing geometrically if that gives a better effect.
As it moves, use the Y coord given by the 360 formula minus the Y offset to position the item. This should start at 0, end at 0 when the velocity is 0 (you don't want them sliding), and reach its apex in between. You can do this simply or with sin, but it probably wouldn't look much better.
If you want, tweak things so it bounces a couple of times

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
3rd January, 2006 at 04:01:47 -

ok. i have saved what you said and am gonna go over it a couple of times (Im not very good with maths)
and hopefully understand it. If you can be bothered is there any chance you could mail me a dumbed down version of what you just said? Like i said before i kinda understand what your saying, and i would really appreciate it due to the importance of this code to my game!

Thx alot

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
3rd January, 2006 at 17:51:58 -

Hi, im really having trouble with this. I kinda understand what Radix is saying but if anyone here could give me some extra help on this i would be very appreciative,
What would be great is some examples or a quick sudo as to how i should do this.

 
n/a

1



Registered
  31/12/2005
Points
  45
3rd January, 2006 at 20:20:21 -

You know what might look pretty cool, though I know you're probably not looking for something like this, but make the items fall from the sky. When you finish a battle a whole bunch of items will rain from the sky into your lap.

 
"O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.." "O RLY?" "Yes Really.."

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
4th January, 2006 at 00:14:55 -

I'll do an example or a diagram or something later, right now my throat feels like I've swallowed a pineapple and it's a little distracting.

I'll probably just do an example, just uh, you're not using TGF are you? because I don't have it anymore.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
5th January, 2006 at 09:51:15 -

@Gabe Thats a really really good idea, i will look into it!

@Radix I know what you mean, i been ill for like 3 days. But if you could do that example sometime that would be excellent. Thank you

 
n/a

Radix

hot for teacher

Registered
  01/10/2003
Points
  3139

Has Donated, Thank You!VIP MemberGOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!
5th January, 2006 at 10:20:37 -

I'll do a little example tomorrow morning perhaps.

 
n/a

Windybeard Games



Registered
  14/04/2005
Points
  219

You've Been Circy'd!VIP MemberCandy Cane
5th January, 2006 at 18:38:40 -

thank you Radix

 
n/a
   

Post Reply



 



Advertisement

Worth A Click