dop2000's Forum Posts

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Yes, you can use touchscreen when previewing your game on PC.

    But I highly recommend testing on the actual phone as well.

  • matriax

    Minimum, maximum and step are easily done with instance variables and a couple of events.

    SliderBar is a Form Control object, and form control objects in C2 have lots of issues - they are rendered above all layers, have problems with scaling, scrolling, parallax etc. I really don't like using them in games.

  • Yep, everything looks perfect.

  • You can change opacity or set instance variables immediately after the "Create" action.

    Instead of "Repeat" use "For" loop and loopindex() expression:

    For "y"=1 to 6

    ...For "x"=1 to 6

    ........create object at (loopindex("x")*40), Y+(loopindex("y")*40)

    ........Object set opacity to 0

    Loopindex (without parameters) works with "Repeat" loops too, but if you have two nested Repeat loops, you can't reference both of them.