99Instances2Go's Recent Forum Activity

  • Make a nested x & y loop.

    Compare to the expression.

    TileAt(x, y)

    Return the tile ID at a position in the tilemap. Note the position is given in tiles, not layout co-ordinates. If the tile at the given position is empty (has been erased), the expression returns -1.

  • There is no use for breaking a function. It always returns to its call.

    A loop you can break with System > (General) Stop Loop. Keep in mind that all actions and events after the 'stop loop' will continue to run, the 'stop loop' just prevents the loop from running again from its top-event.

  • Just create an object, so you can check collissions with a differend object.

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

  • If that is wat you are creating, then i can not think at any reason to use an array.

    Instances and there instance variables are allready basic arrays.

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

  • Shoot till amnunition is not empty.

    Reload amnunition.

    https://drive.google.com/open?id=0B1SSu ... HhqZ1dOQ1k

  • A lot of reasons.

    It will reduce the amount of code, making it managable. Because you have just 1 object and its instances. And you get instance variables for free.

    Construct has all easy code in place to loop/pick/manage instances. Especaly loops are so much easyer. You can ofcours use families, but they lack IID support. And that can give you unexpected suprises.

    Because of the instance variables, and because of the easy looping, instances are easy to lock to an array.

    If you use instances (in stead of all differend objects) the only way to change its appereance is by changing its frame (or animation). So this is in fact is just a logical route that started with choosing to go with instances.

  • If you mean ... if variable has changed AND the condition is true ... then just combine it with a 'trigger once while true'.

    If you just want to know if some variable changed ... then this is (i think) the way.

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

  • Then you gots the solution, there is not really a more performance friendly solution. As long as you dont check for overlaps/collissions in the whole loop, you be fine. Sorry i got on the wrong leg because of this sprite you dragged arround.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Okay. Your inventory should just show the situation. The situation is baked in the Array. So, the inventory shows the array. Thats all.

    To couple something to an array, you need common ground. The most easy way is to give the cells in the inventory a number (instance variable) and that same number on the X-as (y=0) in the array.

    Now you can loop trough the (for each element) Array (with array.curX) and pick the cell with number = curX, to find the cell that goes with the array.

    But you can also loop trough the cells (for each) and pick the corresponding element on the X-as = cell number, to find that element in the array that goes with the cell.

    Maybe it makes no sense to you now, but i got a capx to back it up.

    On the Y-axis you store whatever you like. Just make a comment in your events what each Y is supposed to be.

    In this capx y1= animationframe and y2=amount of found items.

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

    I also wanted to show you how easy it is to use INSTANCES of the same object, that are differend by animationframe (or just by animation) to represent the items that can be found.

    As you see, it is really compact in events, yet this capx does a lot of things.

    Dont understand something, just ask.

  • Did you even open my example ?

  • Exactly the same way as with familys. Not pressing you to drop familys, just a bit afraid that making differend levels can get a bit complicated. But i can be wrong, because dunno where you gooing with this.

    Rule is, use instances when possible, coding gets easyer and slimmer. I think you got confused with the famely this problem (allready). Would you have used instances (and you pick them exactly the same way) i feel that you would have solved this by your own, not beeing confused by the family. Thats is the reason why i expressed my concerns.

99Instances2Go's avatar

99Instances2Go

Member since 12 Feb, 2016

Twitter
99Instances2Go has 2 followers

Trophy Case

  • 8-Year Club
  • Email Verified

Progress

9/44
How to earn trophies