0

I am trying to create a story based animation using jquery and I am using a custom function say("some text") where my character emits a speech bubble. This speech bubble will stay on the screen for 2 seconds. In additional to say() , there are other animation steps such as fly() or jump() etc. Its totally up to the user to decide the sequence. He/She may decide the order based on the story they want

How do I make sure that when user inputs these function more than once, they are executed sequentially and not at once.

Example.

move() //character goes to a position
say()  // character emits speech bubble for 2 seconds
jump() // jumps
say()  // emits speech bubble after first bubble is gone

Any idea how to do this using jQuery or JS? Please note that the order of the sequence is not fixed.

  • you can save the user action in queue and process the queue. It will always execute in sequential manner. – deepak Sep 04 '20 at 06:38
  • I need to keep some functions executing without queues. For example, fly(), where background moves forever. Any idea how to do that? – Get Set Kode Sep 04 '20 at 07:07

0 Answers0