Jump to content


Photo
- - - - -

Quick n' Easy Pendulum Engine


  • Please log in to reply
8 replies to this topic

#1 coollog

coollog

    GMC Member

  • GMC Member
  • 1154 posts

Posted 07 April 2012 - 12:06 AM

  • Title: A quick and easy-to-use pendulum engine.
  • Description: Simulate pendulum motion ;)
  • GM Version: GM8.1
  • Registered: Yes
  • File Type: .gm81 and .exe
  • File Size: 12kB and 4047kB
  • File Link: .gm81, .gmk, EXE


Summary

Hey guys, it's coollog. Haven't posted in a while, been busy with other stuff. But today, I felt like attempting a pendulum simulation, so I made this and it worked out pretty nicely. This simple script works pretty fast and can be used by anyone with half a coding brain, though it may not be completely accurate.
Also included are three useful scripts I've created called string_to_real (converts a string to a real number), get_real (gets user inputted number), and draw_arc (draws an arc fast and precise). I hope you can find these useful =P.

Other Links
Check out this bobblehead dancer made with this engine: http://gmc.yoyogames...howtopic=536281

Screenshots
Here's a screenshot of the pendulum simulator in action (actually four):
Posted Image


Fun
Here are some configurations for different types of pendulums (post some of your own favorites too ;))
// A nice balloon
forcex = 0;
forcey = -10;
mass = 1;
coefrestore = 0.2;
radius = 200;
// Big 'n heavy
forcex = 0;
forcey = 5;
mass = 20;
coefrestore = 0.2;
radius = 400;
// Ring around the rosy
forcex = 0;
forcey = 0;
mass = 1;
coefrestore = 1;
radius = 200;
// It's a storm out here!
forcex = 5;
forcey = 3;
mass = 1;
coefrestore = 0.5;
radius = 300;

Edited by icuurd12b42, 27 July 2012 - 03:21 AM.
removed spoiler tags (AGAIN). dont mess with the template

  • 2
- Creator of Scandux


Latest post: Quick 'n Easy Pendulum Engine
Latest WIP: Bobblehead Pendulum
Check out my other content as well ;)

#2 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 07 April 2012 - 06:55 PM

This is a great little example. short and sweet. It's the first realistic pendulum that I saw that is easily graspable and portable to your game.

Code can be used to make a demolition ball or even floating balloons on a string. Good job
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#3 coollog

coollog

    GMC Member

  • GMC Member
  • 1154 posts

Posted 08 April 2012 - 01:42 AM

This is a great little example. short and sweet. It's the first realistic pendulum that I saw that is easily graspable and portable to your game.

Code can be used to make a demolition ball or even floating balloons on a string. Good job


Thanks!

I have updated the OP with a gmk version of the source file so that ppl with older versions can also use this engine.
I've also added some quirky configurations for different effects you can attain with this engine. Try them out ;)!

EDIT: I've made a cool little bobblehead dancer with this engine. Check it out at: http://gmc.yoyogames...howtopic=536281

Edited by coollog, 09 April 2012 - 12:46 AM.

  • 0
- Creator of Scandux


Latest post: Quick 'n Easy Pendulum Engine
Latest WIP: Bobblehead Pendulum
Check out my other content as well ;)

#4 logstar6

logstar6

    Crosshairgames

  • GMC Member
  • 225 posts
  • Version:GM:Studio

Posted 27 July 2012 - 03:15 AM

Where is the link to download?
  • 0

#5 coollog

coollog

    GMC Member

  • GMC Member
  • 1154 posts

Posted 27 July 2012 - 03:52 AM

Where is the link to download?


Right up there?
  • 0
- Creator of Scandux


Latest post: Quick 'n Easy Pendulum Engine
Latest WIP: Bobblehead Pendulum
Check out my other content as well ;)

#6 icuurd12b42

icuurd12b42

    Self Formed Sentient

  • GMC Elder
  • 18181 posts
  • Version:GM:Studio

Posted 27 July 2012 - 06:48 AM

Where is the link to download?


Right up there?


formerly hidden in a spoiler tag which I removed
  • 0

gmcbanner.pnggmcbanner_tools.png

ICU Live Tutoring Through Slack or Skype | My Tools Page follow.png

I FRANTICALLY MADE MY 18000 POST TOPIC BEFORE MIKE ANNOUNCED A DELAY...
Now I'm squirming not to hit that reply button


#7 logstar6

logstar6

    Crosshairgames

  • GMC Member
  • 225 posts
  • Version:GM:Studio

Posted 27 July 2012 - 02:49 PM

Ok thanks
  • 0

#8 Pixelmancer

Pixelmancer

    GMC Member

  • New Member
  • 6 posts
  • Version:Unknown

Posted 08 May 2013 - 06:52 AM

Every time someone uses dark gray text on a light gray background god kills a kitten.


  • 0

#9 logstar6

logstar6

    Crosshairgames

  • GMC Member
  • 225 posts
  • Version:GM:Studio

Posted 19 May 2013 - 06:22 PM

its ok, they have 9 lives :thumbsup:


  • 0