Asmodean's Forum Posts

  • As far as I know, C2 is designed for exporting Javascript only. Also all plugins/behaviors are written in Javascript. Javascript is a highly dynamic language, means that for example a variable can take a number or a string at runtime. This isn't possible in language like C or C++. In this languages a variable is bound at compile time to a distinct type like string, float, integer ....

    So it's very hard to translate Javascript to C or C++ , the other way around is possible.

    So if you want other exporters you have to rewrite Construct.

  • I dont want the sprite 2 to be in the game and viceversa, what you're teaching me works like that? or both sprites will be in the screen?

    There are both sprite at the same time on the screen in my example. There are several possibilities to have only one sprite at the time on the screen. You can put one sprite outside the layout, make it invisible or destroy it and create a new one every time you switch. I't depends what you want to achieve.

    If it is regardless which position the sprites are after switching make them invisible. If you want to switch positions of the sprites set Sprite1 on position of sprite2 and then sprite2 outside of the layout and vice versa.

  • Be sure that that the else follows direct after the previous event and not as a subevent. It doesn't work with triggered conditions (the one with the green arrow).

    Run if the previous event did not run. Note that this condition does not pick any objects: if it follows an event that picks objects, in the Else event all instances revert to picked again. Else can only follow normal (non-triggered) events. It can also follow another Else event with other conditions to make an "if - else if - else" chain.

    https://www.scirra.com/manual/124/system-conditions

  • I don't know how to switch between two different characters pressing a key (I mean, I want to be able to switch between them pressing the space bar while im playing) its possible to do it?

    You need to use instance variables, because there is no condition to see if the platform or 8direction behavior is enabled.

    You have to set the instance-variables on the start in a state that make sense (one characters has to be the controls enabled the other not). Then you have only to change the instance variables and the conditions.

    I made a little example.

    https://drive.google.com/uc?export=down ... XdLTE1XZWM

  • It got deleted

    Did you get an explanation why?

  • Works like you intended.

    The mouse pointer is the lighter spot above the text-bubble. I suppose that is like it should?

  • No problem here with Firefox 53 (32Bit) and Win7(64Bit). Works how it should.

  • I would do it like this:

  • Isn't the 'falling blocks' example that comes with Construct2 what you want?

  • matrixreal

    Do you have set the cross-origin in the 'load image from url' to none or anonymous?

    If set to non try set is to anonymous.

  • Try to set the parallax in the Layer Properties to 0,0 of your HUD-Layer, that should fix it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • HessamoddinS

    That was only an example that you have to split up your nested loops.

    You have to look how many sprites you have to check every tick. You can do this with a repeat loop:

    You have to try how many loops you need. The 10 is only a guess.

  • First, if you have performance problems. Put the events in groups, the less events in one group the better. Then check the CPU-Usage in the Profile-Tab in the Debug-Layout

    Your performance problem is the function call. You're calling the function from a loop and in the function there is another loop. You have up to 250 sprites and for each sprite you call the function, which is going again trough all sprites. That's an a amount of up to 62500 loops in one tick! (1/60 sec).

    I made a little change, don't know if that's still exactly what you want, but you will see I only check 2 sprites a tick, that will be call the function. So this are only 500 loops a tick.

    The change in the function you can ignore, it was only a test and it seems you're gaining nothing from this change.

    I hope I could explain this well enough, sorry for bad english.

    https://drive.google.com/uc?export=down ... TdYaFM2aHc

  • WebAssembly is about to released:

    WebAssembly CG members representing four browsers, Chrome, Edge, Firefox,

    and WebKit, have reached consensus that the design of the initial (MVP [1])

    WebAssembly API and binary format is complete to the extent that no further

    design work is possible without implementation experience and significant

    usage.

    https://lists.w3.org/Archives/Public/pu ... /0002.html

    One of my biggest hope for Construct3 was support for WebAssembly, but no announcement so far.

    But we will see.

  • It seems that the error is gone in the nightly build of FireFox, so it should be fixed soon in the stable.