dop2000's Forum Posts

  • You can only request full screen after a touch event (but not "on Touch start"). For example:

    On any touch end: Browser Request Fullscreen

  • Add a tag "music" to your music playback. Change your event to this:

    Audio Tag "music" is NOT playing -> Audio play "MyMusic.mp3" with tag "music"

    What do you want to control will this slide bar - music volume?

    On slidebar change -> Audio set "music" volume to slidebar.value

    Here is how you properly change audio volume:

  • Hi irina

    I replied you in PM.

  • So basically take a random item from the inventory and drop it on the ground? You shouldn't have used the word "spawn", it usually means creating something new

    Anyway, here is the code:

  • worm1

    Here you go:

    https://www.dropbox.com/s/phwh7xejbayll ... .capx?dl=0

    Simple code, no arrays. You can even remove the ID variable and use IID instead.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Seriously, why do you need this array? Working with instance variables in C2 is much easier than working with 2D arrays.

    If you are sure that you need the array, consider doing this:

    Create 1-dimentional array, set Global=No, add it to the same container with the sprite. Now each instance of sprite will have its own instance of array for values. Sprite+array in each pair will be logically linked together, you'll not need the ID variable. You can pick a sprite and its own array will be picked automatically, and vice versa.

    This code will search all arrays for a number N and destroy sprites (and their arrays) if the number is found:

    For each Array
       Array For Each X Element 
           Array Current value = N    ->  Sprite destroy   
    [/code:ak13oj4u]
  • You can add gravity to Bullet behavior, don't need physics for that.

  • Try adding these actions before the "AAAT acquire target":

    AAAT clear turret targets

    System Wait 0

    If this doesn't help, could you share your capx?

  • It depends.. If your objects are simple shapes (circles, rectangles), you can do this with math.

    If you need to roughly detect several stages of overlapping (touching, some overlapping, overlapping a lot), you can scale down the original sprite to 0.9, 0.5, 0.2 etc., every time checking if it's still overlapping another sprite. And after that return it to 100% size. Overlapping checks are quite fast, so you can do all this in one tick.

    Also you may find some useful ideas in this post:

  • I made quite a lot of changes, enjoy!

    https://www.dropbox.com/s/dtcc5uplj25gw ... .capx?dl=0

  • Or use a dictionary. You can store "box1", "box2", "box3" keys in a dictionary and access them using expressions like Dictionary.Get("box"&N)

  • So you want to spawn a copy of one of the items from the inventory?

    And what do you mean by "no duplicates"? Once one item is spawned, it can't be spawned again?

    Here is one way to do this:

    https://imgur.com/a/okN1n

  • Every second?? Did you mean every tick?

    You can add Fade behavior to that ski trail sprite, to make it slowly fade away and get destroyed after a few seconds.

    Also instead of Pin you can add Bullet behavior with the same speed and direction as your background moves.

  • Turret with predictive aim should work much better than path finding.

    If your bullets are small and moving fast, they can pass through each other "in between frames", faster than the system can detect collision.

    You can try making their collision polygons bigger.