The Daily Click ::. Forums ::. Klik Coding Help ::. Bouncing Ball code
 

Post Reply  Post Oekaki 
 

Posted By Message

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
28th June, 2007 at 17:10:35 -

I have been challenged by a friend of mine who believes it is easier to make a realistic bouncing ball in flash than it is in MMF2. I want to show him that it can be done just as well in MMF2. I have got some guidelines to work with:

Affected by gravity
Should bounce off pins correctly just like the coin pusher games when you drop your coin in
Correct direction of spin relative to bounce
Should eventually stop bouncing

those four conditions have to be met in order for me to get this to work. can anyone help?

 
n/a

axel

Crazy?

Registered
  05/02/2005
Points
  4766

Game of the Week WinnerYou've Been Circy'd!
28th June, 2007 at 18:11:38 -

Can they really be compared, just like that? Flash uses a C-style scripting language to do stuff. But whatever, I might just give it a try tomorrow. I can't code things at 2:00 in the morning.

 
n/a

Liquixcat

Administrator
Lazy Coder

Registered
  08/12/2002
Points
  201

VIP MemberLikes TDCKitty
30th June, 2007 at 01:11:44 -

Well I've made one in MMF and I've made one in Actionscript. I assure you, your friend is correct.

 
thinking is like pong, it's easy, but you miss sometimes.

»xerus



Registered
  28/06/2002
Points
  675

You've Been Circy'd!Game of the Week Winner
30th June, 2007 at 02:29:04 -

I'd like to see the MMF events that do this if anyone does accomplish it o_o

 
n/a

Flava



Registered
  30/07/2002
Points
  684

Has Donated, Thank You!Code MonkeyVIP MemberThe Cake is a LieThe Spinster
30th June, 2007 at 05:51:57 -

It is much easier to do in Flash than in MMF2 - it's still possible in MMF2, just requires more work I believe (and more brains).

Image Edited by an Administrator.

 
This is a signature. Have this one on me.

yuyu



Registered
  13/05/2003
Points
  202

VIP Member
1st July, 2007 at 01:49:08 -

yea, mmf needs an upgrade that can detect the angle of a collision. Then it would be easier than flash.

 
n/a

BROO



Registered
  31/10/2002
Points
  595
1st July, 2007 at 09:52:47 -

Detection of ball collision can be made good ONLY if you have walls as vectors.

There are always some neat other options, but they will not work correctly in every situation. Most of them will give you a very big angle calculation errors (for example: 40-60degree).

Your friend is absolutely right. It seems you haven't ever tried to make such movement.

 
n/a

Willy C



Registered
  14/02/2004
Points
  1524

Game of the Week WinnerKlikCast StarPicture Me This -Round8- Winner!VIP MemberWii OwnerIt's-a me, Mario!Hero of TimeThe Cake is a LiePS3 OwnerI am an April Fool
Batman!Teddy Bear
1st July, 2007 at 10:16:44 -

...You mean something like this? Made in MMF1.5:
http://www.clickteam.com/mbfiles2/277070-BallToy.cca

 
http://www.robocaptain.com

vortex2



Registered
  27/05/2002
Points
  1406
1st July, 2007 at 14:46:23 -

Flash is quite a bit easier. MMF 2 is not conductive to something that has a large amount of variables and calculations. Also the whole inability to get the normal of a surface is a real problem.

If that wasn't enough Flash also has a number of things to make tweening easier and it even has a few open source physics engines for it: http://www.cove.org/ape/demo1.htm

Now I have been working for the past year or so on an MMF 2 physics extension but vectors are better for displaying the results then bitmap graphics . The main thing that currently chokes up the MMF 2 engine is rotating active objects as it is slowww. Hopefully with HW acceleration this will improve.

So I hate to say it, but your friend is right. Not only that but I made that ball toy example .

Image Edited by the Author.

Image Edited by the Author.

 
A bit of insanity with every bite!

lembi2001



Registered
  01/04/2005
Points
  608

VIP MemberIt's-a me, Mario!Wii OwnerI like Aliens!Has Donated, Thank You!PS3 OwnerI am an April Fool
17th July, 2007 at 17:40:47 -

That ball toy thing is just what i was looking for (sorry for the delayed response been on holday)... Gonna show him this tomorrow. cheers


 
n/a
   

Post Reply



 



Advertisement

Worth A Click