dop2000's Forum Posts

  • So you need the condition to check that the variable is any number except for 2, 3 or 4, is this correct?

    (variable<>2 & variable<>3 & variable<>4)=1

    • In a sprite with multiple animations, changes to image points and collision polygons sometimes are not saved. I think this happens more often after adding/importing new animations, but I couldn't reliably reproduce this bug.
  • Hard to help you without the project file. Make sure the UI layer has parallax and scale rate set to 0.

  • Save these values to an array or dictionary. For example:

    On every tick
     Dictionary Set key "Tick_"&tickcount to Player.x
    
  • Here are some changes:

    There are 3 variables to control the spinning, you don't actually need any of them!

    Make sure to use delta-time (dt) when changing anything on every tick, like the animation speed.

    I don't understand what events 45-46 are supposed to do, so I can't tell you how to fix them.

  • Nope, no disadvantages!

  • Not sure if I understand the question. Why do you need to invert these conditions?

    If you need combine two "on key pressed" triggers like this:

    On Down key pressed
    OR On Shift key pressed
    

    then this is possible. Create one trigger, right-click it and change it to an OR-block. After that you will be able to add another trigger.

  • You do not have permission to view this post

  • If you load the game on start of layout, but also want sometimes to restart the layout without loading, here is the easiest solution:

  • See the "Text editor" example above. "Read" action is asynchronous, you need to wait for "On file operation complete" trigger.

  • Find out what's using the most space. My guess would be music and sound files. If that's the case, try re-encoding them at a lower quality, for example, using mono instead of stereo.

    If you have a lot of graphics, try exporting with lossy compression. It’s not like JPEG, and it won’t ruin your pixel art. Chances are, you won’t even notice the difference.

    Another option is to export with PNG images and then compress them using Pngquant. Again, you likely won’t see any visual difference, but image sizes can be reduced by 30–50%.

  • How big is the project? Do you have enough free space on your hard drive?

    If you have multiple drives, make sure there are at least a few gigabytes free both on the drive you're trying to save to and on the system drive.

  • You can also use ternary operator. Say, to increase the number up to 10, then reset to 0:

    Set var to (var<10 ? var+1 : 0)

  • The easiest way to link three objects together is to use a container. That way, you won’t need the ID variables — picking one instance (like the hitbox) in events will automatically pick the other two objects in the same container.

    Another option is to use a hierarchy, with one object as the parent and the others as children. Then you can use "Pick parent" and "Pick children" conditions. Hierarchies also let you move all the objects as one unit.

    You can even combine both approaches: container+hierarchy for ultimate flexibility!

    .

    The way you organize your events is pretty inefficient. Running a For Each loop on every tick and nesting everything inside it (even triggers) will hurt performance, especially with many enemies. Triggers should generally not be placed inside other events.

    Never use "Trigger once" condition with objects that have multiple instances or inside loops - it only leads to bugs that are hard to debug.

    Finally, you need to tell the DEATH function which enemy instance to destroy, otherwise it may destroy the wrong enemy. Add a parameter EnemyUID, and pass enemy.UID in this parameter when calling the function.

    So the correct code should look like this:

    // Parent event
    Player on collision with Enemy
    Player is not dead yet
    
    ... // sub-events
    ... Player is immune -> Call function ENEMY_DEATH(Enemy.UID)
    ... Else -> kill the player
    
  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads