Be a Supporter!

On the Subject of Spring Emulation

  • 321 Views
  • 7 Replies
New Topic Respond to this Topic
Randomini
Randomini
  • Member since: Jul. 7, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
On the Subject of Spring Emulation 2009-03-14 21:37:56 Reply

Ever wanted to make a true-to-life spring in flash? So did I. So I did.

You can see my first attempt here (use the mouse). If you have a look at it, it's kind of obvious that it's not acting too realistically. When you approach the object on the spring, the speed it moves away from you doesn't increase much - it's going very slowly, in fact. Also, it is prone to stretch a lot when you move your mouse away.
That got me thinking - how do springs work in real life? The more they are compressed or stretched, the harder it gets to compress or stretch them. As such, I made the force applied proportional to the distance from the mouse that the object is. I then chucked the whole thing in a class, and *tah dah*, you've got a fancy and Realistic Spring Effect.
So after 2 days of experimenting I've finally gotten what I wanted.

Randomini


BBS Signature
KnightInShiningArmor
KnightInShiningArmor
  • Member since: Feb. 22, 2009
  • Offline.
Forum Stats
Member
Level 04
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-14 22:41:00 Reply

Nice. Do you have any ideas of what you could do with it?


People who say CS4 is bad just don't understand it.

BBS Signature
Alexman159
Alexman159
  • Member since: Sep. 19, 2007
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-14 22:47:07 Reply

you could make a defense game with a spiked paddle ball as the weapon. =3


Response to "dumbest person you ever met" :
"Some girl I knew once forgot how to breath." -Dlxrevolution

BBS Signature
LeechmasterB
LeechmasterB
  • Member since: Apr. 1, 2005
  • Offline.
Forum Stats
Member
Level 17
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-14 23:03:18 Reply

Its buggy somehow, you might want to look into verlet integration.

Randomini
Randomini
  • Member since: Jul. 7, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-14 23:50:19 Reply

At 3/14/09 10:41 PM, KnightInShiningArmor wrote: Nice. Do you have any ideas of what you could do with it?

Oh, I dunno... a little something like THIS!!!
(arrow keys to move)
(i know it sucks right now)


BBS Signature
Randomini
Randomini
  • Member since: Jul. 7, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-15 00:04:59 Reply

At 3/14/09 11:56 PM, KevnSevn wrote: You should try to add a gravity effect to it.

Yeah, gravity's the obvious next step.

Try making 5 or 6 of them all in a line, to get like a rope effect.

I did that, but it wobbles like crazy. A spring on a spring on a spring on a spring isn't the most stable of constructions :D


BBS Signature
Ansel
Ansel
  • Member since: Sep. 2, 2006
  • Offline.
Forum Stats
Member
Level 24
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-15 00:47:23 Reply

Make a virtual paddle ball.

On the Subject of Spring Emulation


BBS Signature
Randomini
Randomini
  • Member since: Jul. 7, 2006
  • Offline.
Forum Stats
Member
Level 13
Blank Slate
Response to On the Subject of Spring Emulation 2009-03-15 01:54:46 Reply

At 3/14/09 11:50 PM, Randomini wrote: (i know it sucks right now)

BETTER.


BBS Signature