Guizmus's Recent Forum Activity

  • Your essential problem is that you are referencing objects of the same object type, so "block.Variable" may reference one or the other.

    To simplify things, I would go with something like this.

    One function is called to select the frame number of the other block. This function is called using "Function.Call", and so sets a return value.

    Only thing that isn't done in this example is the verification of existence of another block below the current one.

  • Ok, so your problem comes from the event number 12. There, you select all the moving friends, then filter them using the boolean "isEngaging". The problem is in your comparison after that. You compare distances using the Friend.X, Friend.Y, ... When you do a system comparison (like here), it should be known that, when multiples elements are selected, only the one with the lowest UID is used in the calculus. In your case, you have a selection of 2 moving friendly units. When the first one reaches the enemy, the condition is verified, but you still have the 2 moving units selected, so the "Stop" event 14 is applied to both units.

    What you want : use a forEach condition on event 12 (yes, add the condition with the 2 other ones already there), and the events will be evaluated for each moving friendly unit, individualy.

  • Restarting the layout seems... kind of harsh too here.

    You have some kind of lift, and it doesn't stop going up, here is your problem. You should have it go down after some time. What if the player falls from the lift ? Is he supposed to suicide in order to restart ? It would be strange...

    If at some point you detect that the player is on the platform, you could also start to test if the player is still on the platform, or if the platform has reached its top position. When this happens, you could then start to move the platform down again.

    If all this doesn't go with your plan, you could also use the "savestate" functionality. At the start of the game (after the layout starts), save your game (System : Save). At the end, just reload this save. Now, add the behavior "nosave" on everything that is supposed to not be reset between the player's try, like the highscore, the number of life, ... And here you go

  • There is a radial blur effect.

    In the sprite properties, you can see multiple things : variables, behaviors, but also "effects". Add the effect "radial blur", and here you go

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Wow... 82Mo for the capx ? I bet the image is rather large in fact ! Maybe you should use smaller resolution ? I'll take a look after download, but this isn't a good sign... How much VRAM does your program take ?

    When something is lagging/not working right, try to use the Debug Layout feature, as there is a tab with Performances Profiling, helping you understand where the bottle neck is.

    EDIT after DL : yes, try to cut your image in multiple pieces. This is the origin of your problem here. After all, there is only 3 objects for now, and I'm already at 40FPS (bad computer but still)

  • And here is an example on how to download an array as a json file, and how to load an array from a json project file. (the project file is empty, it's only for the events)

  • QuincyDK

    i'm not sure I follow entirely what you want but here is my take on it.

    If you need to populate an array based on a JSON you build outside of C2, there are 2 ways :

    • if you want to load the JSON during runtime, you could have the JSON file in the project files, and just replace it on your server. Use an event "On start of layout : AJAX load project file myJSON.json" and another "AJAX on finished loaded : Array.loadFromJSON(AJAX.LastData)"
    • if you want to populate the array before the runtime (so inside the C2 editor), just add an event "on start of layout : Array.loadFromJSON(X)", where X is the string representing the JSON content (in one line of course).

    If you need to have the format of an Array JSON representation in C2, just do some Alert or console.log of a populated array during any runtime, and copy paste its "asJson" expression.

    I hope this was what you were looking for, I'm not sure at all x)

  • For runtime, using the array will be easier.

    For saving/restoring purposes you can get the datas of an array object as JSON quite simply, using the expression "Array.AsJSON". Then, you have to use this JSON. As it's for a back-end dev, I would suggest sending it via AJAX.

    Something like this.

  • Well, not sure if it was you, but there was a similar topic a second ago and I made an example. Here is my answer, as the topic has been deleted, and you have the same problem (if anyone searches for it someday)

    Here is an example.

    You do the following :

    • Add an event "Sprite : On created", and disable the effects there.
    • Add a simple "Mouse over object : Sprite" event, enabling the effect, and an else, disabling it.
  • The wait function is dangerous. As if forces the function to wait, the events go on and the "context" isn't kept. As the Params are in the context, you don't have access to them after...

  • Just after the event where you start to spawn particules, put an "Else" => Particles->Destroy

  • This surely is a little error somewhere in the function call, could you show us the problem with a capx ?

    I did an example not long ago about functions, if this can help you.

Guizmus's avatar

Guizmus

Member since 26 Mar, 2013

None one is following Guizmus yet!

Trophy Case

  • 11-Year Club
  • x4
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

15/44
How to earn trophies