dop2000's Forum Posts

  • Laurent So while one instance is moving, all other instances should wait? And only when the first instance reached the target position, then the next instance should begin moving, is this correct?

    Then your plan looks good, although instead of X counter I suggest using an instance variable on the sprite. For example, "isArrived". Pick a random instance with "isArrived=0" (see my previous comment), and when it arrives, change its value to 1.

  • winstreak It's better to put "Every X seconds" as the first condition for better performance. Also, since you are picking one random instance, you don't need the "for each" loop anymore. So here is the easiest way to do this:

    Every 0.5s
    Sprite Bullet is NOT enabled
    Pick random Sprite
    ....... Sprite set Bullet enabled.
    
  • winstreak There are quite a few mistakes in your video.

    Trigger Once condition should never be used with multiple instances. It also makes little sense using it inside loops. And in any case it should come as the last condition in an event.

    Also, For Each loop already picks instances one by one, so picking nearest in a sub-event is unnecessary, it will have no effect.

    Finally, you should put "Every 0.5s" and "Is not activated" condition before "For each", to improve performance and filter the picked scope of instances, before iterating them.

    .

    If you need to pick a random instance, there is a System condition for that.

  • How do you create the House sprite, with an event? When you create an instance in runtime, "On created" is triggered immediately, even before you select a different animation for the newly created sprite. So in the "On created" event the sprite will have the default animation, which I suppose is "Trailer".

    You need to initialize the tween values in the same event where you are creating the house. Or make a function, which you can call after you've created a new house and set the right animation for it.

  • Here is how you do this with a local variable:

  • Drawing Canvas is not a good choice for animations. You need to make a snapshot after every frame and save it in an array, then restore it from the array - these are very slow operations. You can also save the canvas image in BinaryData, but there is no way to load it back into the canvas.

    Have you tried Game Recorder object?

  • I think it's a very bad idea to make user to change date on their device. This may cause many issues with other apps - reminders, scheduled tasks, automatic backups, antivirus software etc.

    Besides, I checked on my phone and it doesn't allow me to set the date earlier than 01/01/2007

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use a loop with Wait, for example:

    For each Sprite 
    .. Wait 0.2*loopindex
    .. Sprite set invisible
    

    A problem with wait is that once it's running, you can't stop it. So a better solution may be using Timer behavior.

    For each Sprite 
    .. Sprite start timer "make_invisible" for (0.2*loopindex) seconds
    
    Sprite On Timer "make_invisible" 
    .. Sprite set invisible
    
    
  • I think every time you click, two events are triggered.

    I suggest you use "System is within angle" condition:

    Mouse On Left button clicked
    
    (subevents)
    .. Local variable a
    .. Set a to angle(player_hitbox.x, player_hitbox.y, Mouse.x, Mouse.y)
    
    .. a is within 30 degrees of 0 : Simulate pressing right
    .. a is within 30 degrees of 90 : Simulate pressing down
    .. a is within 30 degrees of 180 : Simulate pressing left
    .. a is within 30 degrees of 270 : Simulate pressing up
    
  • You can get the real text size using expressions Text.TexWidth and Text.TextHeight

  • Add Browser object to your project. Add "Browser Log" action to the events you want to debug.

    Start the preview, press F12, open Console log and check your debug messages there.

  • The code should work. How do you know that physics is not disabled, have you checked in Debug mode? Try adding Browser Log action to these events, see if they fire. Check collision polygons in all objects. Or maybe some other event is enabling the behavior.

  • Export the game as debug APK. Then transfer this APK file somehow to your phone. You can connect the phone to your computer with USB cable, or send the file by email etc.

    Then locate this APK on your phone and tap it to install.

    You may need to allow "installing apps from unknown sources" in your phone settings.

  • It's not recommended to drag physics objects when Physics is enabled.

    But what you described should work. Try something like this:

    Sprite is dragging
    
    ..Sprite is overlapping PinkArea : Sprite set physics Disabled
    
    ..Else
    ..Sprite is overlapping YellowArea : Sprite set physics Enabled
    
  • If the boxes should not move, simply set them as immovable.

    If they need to be moving, it may be difficult to get rid of that twitching. You can try experimenting with settings like elasticity, friction etc. Or briefly (for 0.1 seconds) set them immovable with an event, maybe this will calm them down..

    If your main concern is the gap, you can decrease the size of collision polygon in the box sprite by 1px at the top of the box.