call function

0 favourites
  • 12 posts
From the Asset Store
Basic clone of a 80's arcade game called Gyruss that was quite fun to play!
  • trying to set up a call function but it isn't working.

    I have placed a call function inside an event sheet ( this event sheet runs at start up)

    first picture:

    https://db.tt/rZy02MZ0

    I have placed the "on call" function inside my main event sheet

    second picture:

    https://db.tt/3c4XC5Ah

    so basically, inside an event sheet that starts at the beginning of the program, it is suppose to use the call function after an animation trigger.

    The problem is that it doesn't matter if I have the "on call" function on the event sheet or not. As long as I have the "include left-side" sheet on the main event sheet it runs. I only want the "include left-side" to run if it is called.

    so how do I get the on call function to work correctly?

  • I would say it is calling because animations start at frame 0, so it's going to be called immediately, which is what you are seeing. The function is working. Your logic seems wrong.

  • but there is an animation on frame 0. i can change the animation frame to something else and it makes no difference.

    If I remove the "on left-side" function on the main event sheet ( second picture) and just leave the "include left-side" event sheet, the "left-side" event sheet still plays. So basically, the on-call function ( first image) isn't doing anything or I have it setup incorrectly.

    I'm trying to make it so the "left-side" event sheet doesn't play UNTIL the "on-call left-side" function..calls it.

    I'm just not understanding on call function....

  • Here's a simple example. When the animation reaches frame 6, it will call the function to rotate the sprite to 45 degrees.

  • thanks for the response.

    So how would I include an event sheet to the function on "myfunction"?

    on "myfunction"

    include event sheet

  • The event sheet include is global. You can see I have it at the top of Event sheet 1 (including Event sheet 2).

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • the only thing I don't understand is that you have: on "myfunction" ...sprite...set angle to 45

    what I don't get is I want to: on "myfunction" call a different event sheet.

    I'm sure you are explaining it but I'm not grasping it..I'll play around with it

  • I'm calling Set angle just to prove the function is called. If you run the example, you see the snail animate, and then on frame 6, it calls the function and also rotates 45 degrees.

    You may want to move the function off of the Main event sheet (lets call it the Function event sheet). Then on the Startup event sheet include that event sheet. You may have things backwards.

  • yea. I'm not getting it. I mean, I understand what you have but I don't understand how to make it call a specific event sheet.

    No matter where I put the functions, the event sheet plays regardless if I am even calling it.

    I can't figure out how to make the event sheet NOT play until it is called but since it's already a part of another event sheet, it plays automatically. Does that make sense?

  • No. I'm sure you care calling it. Functions aren't called unless you call them. Remove your call temporarily and see.

  • I have and the event sheet still plays

  • I just PM'd my capx....

    can you show me what I am doing wrong?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)