Animating Actor to a Music?

theabbott

  • Posts: 271
Hello Stencylers!

I'm working on a sort of Rhythm game and would like to able to animate an actor to the Rhythm of the BGM. I've found an AS package called "BeatTimer" (http://www.libspark.org/svn/as3/Utils/src/org/libspark/utils/media/BeatTimer.as) which probably does what i need it to do. However, I'm a complete coding noob and want to ask if this AS package can work in Stencly and if so how do i get it working into my code?

Thanks in advance,

theabbott

  • Posts: 271
In case anyone else is trying this stuff - here's a great thread exploring setting up a beat timer and synchronizing things to the timer.

http://community.stencyl.com/index.php/topic,2060.msg14319.html#msg14319


Any other related threads/advice is greatly appreciated!

Thanks all!

SquareNote

  • Posts: 20
Hi theabbot -- I've been away from Stencyl for a while but I wanted to jump in and say that the thread you linked to isn't actually solved, it turns out. I thought it was working but it still drifts away from the beat after a time pretty easily if there's a lot going on or if you leave the browser window and come back.  I'm going to start investigating this again soon and I'll take a look at your AS package link too when I do.  A generic, block-based solution for keeping events synchronized with music over time would be ideal and probably useful for a lot of projects. But I'm not a programmer either so this nitty-gritty stuff is all pretty arcane to me.

« Last Edit: March 23, 2012, 02:18:52 pm by SquareNote »

theabbott

  • Posts: 271
Hey Squarenote,

Please see my response here: http://community.stencyl.com/index.php/topic,4320.0.html

Again thanks for looking into this! - Agreed a custom block based solution would be ideal and useful to loads of different projects. Hope we can make some headway on this and the other sound features..

Ryusui

  • Posts: 827
This topic might help. It describes the process of adding external AS3 files to a Stencyl project.

http://community.stencyl.com/index.php/topic,8781.0.html

Basically, you copy it into a freeform code behavior and make sure the first line says "package scripts {".
In the event of a firestorm, the salad bar will remain open.

theabbott

  • Posts: 271
Thanks Ryusui!

So after importing the library (.as) file and creating the freeform code behaviour, How would i call the functions/classes in a new behaviour?

Ryusui

  • Posts: 827
It's all explained in the other thread. Make sure the class is named identically to the AS file and call as usual. You can just use one-line Code blocks, if you like.
In the event of a firestorm, the salad bar will remain open.