Alert icon
We're changing our privacy policy. This stuff matters.  Learn more  Dismiss

[ 弾幕風 Tutorial ] MainLoop style scripting

Loading...

Sign in or sign up now!
Alert icon
Upgrade to the latest Flash Player for improved playback performance. Upgrade now or more info.
819 views
Loading...
Alert icon
Sign in or sign up now!
Alert icon

Uploaded by on Feb 27, 2010

Around forums, pms and comments I noticed that people terribly mix up the MainLoop and Tasking method. Or try to choose one of them but end up being engulfed in errors. That is why this simple and short tutorial will explain exclusive how to use the MainLoop. Just note that I am not intending to make more tutorials with MainLoop style scripting.

There is a HUGE miss understanding about the 'yield' inside a MainLoop. People treat it as if the MainLoop is halted or ignored. This is only partially true. Adding a Yield means the MainLoop will at the end check for stuff to do. The 'Yield' is nothing more than a brief "pause" that allows the game to check for other tasks. This is why we also yield regular loops in previous examples. Same logical explanation that if you don't 'yield' your MainLoop it will never execute other tasks.

Is a combination possible? Yes. Why do you think we have been putting the Collision detection inside the MainLoop? It was already a combination but we didn't script any danmaku or so inside the MainLoop. Because tasking already does that. But sometimes people have clever work around with it.

Category:

Gaming

Tags:

License:

Standard YouTube License

  • likes, 0 dislikes

Link to this comment:

Share to:

Uploader Comments (DoubleVla)

  • ehm, just a question, not for the tutorial, it's for the SFX's.

    Reimu's spellcard initial sound was not the original from danmakufu, how did you put it?

  • @UzumakiTenma2

    create a folder named 'se' in your root folder, and place the WAV file with the following exact name in there sePlayerSpellCard.wav

  • I just realized, at first, you were having it set to fire a bullet every 60 frames, but with a 30 frame delay before the first one, not a bullet every 30 frames like you said.

  • Ah you are entirely correct. Firing bullet at 30 frames will cause it to refire after 60 frames again ( +30 frames to reach 60 for reset, then 30 frames from 0 to 30 to fire again )

    Urgh =S and this is why I didn't wanted to make this tutorial actually. It's useless if it is explained horrible. I guess I should add an annotation at that point.

see all

All Comments (9)

Sign In or Sign Up now to post a comment!
  • I just checked this video because my "maintask" wasn't working, with it, error, without it, cirno wouldn't fire. >_>''

    Ah BTW, you're awesome.

  • Add "if count%60==0" to this video or I won't forgive you! :V

    That way you won't have to reset the timer to 0 every 60 frames, which makes things so much more comfortable to work with.

  • i just realized... this looks pretty similar to Java... so i might be able to do some scripting after all ^^

  • fake accent + real accent = epic accent

  • What ever makes you happy, ze!

    Ik rolde over de vloer lachend op dat punt.

Loading...

Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more