The Daily Click ::. Forums ::. Klik Coding Help ::. Generate a random value
 

Post Reply  Post Oekaki 
 

Posted By Message

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
7th August, 2007 at 13:23:51 -

Hey.

I need an animation to be selected at random when two objects collide with each other, how can I do this?

Cheers for any help.

 
Image

Tell 'em Babs is 'ere...

Matt Boothman

The Nissan Micra of forum members

Registered
  20/09/2002
Points
  109

Game of the Week Winner
7th August, 2007 at 15:30:38 -

When objects collide, set alterable value to Random(5), for example. Then, when alterable value = 0, set anim to Anim A, when alterable value = 1, set anim to Anim B etc etc.

There is a beautifully written and well researched article all about random here: http://www.create-games.com/article.asp?id=1633

 
http://soundcloud.com/normbo - Listen to my music.

-Liam-

Cake Addict

Registered
  06/12/2008
Points
  556

Wii OwnerIt's-a me, Mario!Hero of TimeStrawberry
7th August, 2007 at 16:15:48 -

Aha! Thank you Mr. Boothman!

And your right, that IS a well written article

 
Image

Tell 'em Babs is 'ere...

DaVince

This fool just HAD to have a custom rating

Registered
  04/09/2004
Points
  7998

Game of the Week WinnerClickzine StaffHas Donated, Thank You!Cardboard BoxDos Rules!
7th August, 2007 at 20:16:14 -

"Then, when alterable value = 0, set anim to Anim A, when alterable value = 1, set anim to Anim B etc etc. "

Isn't there something like using a calculation to change the animation sequence? Then this could be simplified with "set animation sequence to Random(amount)".

Problem is I don't know how it numbers the animation sequences, and they'd probably have to be right next to eachother.

 
Old member (~2004-2007).

Del Duio

Born in a Bowling Alley

Registered
  29/07/2005
Points
  1078

GOTW WINNER CUP 1!GOTW WINNER CUP 2!GOTW WINNER CUP 3!GOTW WINNER CUP 4!Evil klikerHasslevania 2!The OutlawSanta Boot
9th August, 2007 at 11:02:09 -

It should also be noted that at least in MMF1.5, it'll say something like put in the animation number, 1 should be first.. Anyways, it's NOT first- it's the second one. If you want the first animation you need to put in a zero, even though it says otherwise.

This is the same for changing / forcing frames of animation.

 
--

"Del Duio has received 0 trophies. Click here to see them all."

"To be a true ninja you must first pick the most stealthy of our assorted combat suits. Might I suggest the bright neon orange?"

DXF Games, coming next: Hasslevania 2- This Space for Rent!
   

Post Reply



 



Advertisement

Worth A Click