chunchun's Forum Posts

  • I used keyboard. iskeydowm to judge, but it can only be used with a hold-down, not just press once.

  • Take a look at the 'Ghost shooter code' example. That stores various instances in global variables, which can also be used in scripts in event sheets.

    Thank you for your answer. I learned a lot from this <Ghost shooter code>.,I got a lot of help with this question. Thank you.

    In addition, is < await ()> equivalent to "wait" in the event table? I don't know how to use him yet. How do you make it wait a few seconds in script?

  • Each script block in an event sheet has its own scope, so local variables aren't shared. If you want to share something between them, you could use global scope instead.

    I'm not a professional, but it's great to be able to break down the scope barriers between blocks of code. Those that are retrieved once (retrieved instances) can be invoked directly in all blocks of code only once.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • In each block of code, for example:

    	const a =runtime.object["a"].getfrisinstances();
    	
    

    We hope to get an instance of a once, and then call a. ***() in each script block.

    Instead of getting an instance of A once in every block of code that needs to call A.

    That makes it feel better to take advantage of the logical clarity of script code and reduce more useless code.

    For example, I wrote in the first code box: const a = runtime. obkect ["a"]. get ** ** ();

    Then I can call the instance a directly in each individual script box.

  • Refer to the Scripting reference in the manual for available scripting APIs. For example if you look up the Sprite object's script interface you'll see animationName is read-only, and there is a separate method to set it.

    Thank you for your answer. I still want to know how to control behavior with code. I see that the updated project already has script control to behavior over 8dir and platforms.

  • In different script blocks, those variables or instances that are retrieved need to be retrieved and invoked once with const. Is there any way that you can use it again and again with only one call without use const in every script blocks?

  • You do not have permission to view this post

  • I'm not in complete script . It's in combination with events. I've got this Instance, and I've bound eight directions to it. I want to know how to use code to control 8-way behavior. For example, modify the maximum speed, or analog control and so on.

    I also want to know how to manipulate its animation. I tried to switch the animation using the following method, but it didn't seem to work.