99Instances2Go's Forum Posts

  • [quote:1ww7d23d]So on Layer 2 of the game I have (Finger touching Menu_button goto Menu layer) and the other one is (Finger Touching Retry_button Goto Game layer)

    Layer 2 ?

    Go to layer ? ?

    You have no layout called "Menu".

  • Update (you always should) to last stable version.

    https://www.scirra.com/construct2/releases/r233

  • It only targets one. <img src="{SMILIES_PATH}/icon_mrgreen.gif" alt=":mrgreen:" title="Mr. Green">

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

    Modified your capx to clearly show things.

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

    (hope it was ok to be lazy, you did most of the work allready)

  • Yeah, but does it target only the single instance of the object that's overlapping?

    'on collsion' or 'on overlap' (found in the sprites conditions) selects the player as well as the overlapping sprite(s).

    All sprites that, on the moment of checking, overlap the other sprite. Meaning, if you got multiple sprites overlapping, you mostly should use 'for each sprite'. Or combine it with a pick condition that filters some more.

    None overlapping sprites are not selected.

    'on collisions' Is bit different in the sense that it is a trigger. Triggers can happen multiple times in a tick. It happens collision by collision. So it sets objects 1 by 1 selected.

  • Dont understand why you dont use the turret behavior.

    Give it a range, target the player. Give it intervals.

    'on target aquired' start the shooting animation

    Then 'on shoot' spawn the bullets.

    Done.

    Or.

    'on target aquired' start the shooting animation

    'on animation end' spawn the bullet and restart the animation

    You need the lineofsight only if there are obstacles in play.

    In that case.

    'on shoot'

    'has lineofsight'

    spawn the bullets

    or

    Or.

    'on target aquired'

    'has lineofsight'

    start the shooting animation

    'on animation end' spawn the bullet and restart the animation

  • 'on collsion' or 'on overlap' (found in the sprites conditions) selects the player as well as the overlapping sprite(s).

  • You have the bring in front/back in the sprite actions. They might be easyer.

    For the system Z-order action, you need to give instances an instance variable, and give each a value. Z-order will sort depending on that value. Hence, it only orders instances. Newly created objects need a value givven to that instance variable.

    Unless you have access to families. Then you can use a familie variable to sort.

    Renember that you can not read from a newly created object until the next top-level-event. Meanig, you can NOT use the sort action in the same sub level as the creation action.

  • Ive done it before not using array but id like to do so in a smallish functional way without doing hundreds of events. So far with oosyrag help ive figured out how to choose the monster and have it updated the stats on the battlefield for a base stats but now i want to update its stats in relation to the chosen level.

    An array is not more then a list of variables.

    Now. When using instances and instance variables, you in fact have a 'list of variables'. Because instance variables are personal, owned by a certain instance. Therefor, dat is in fact an array.

    You can handle every instance of an object with one line of code. So, that is not piling up lines of code.

    I understand that you have base value for things, that changes in relation to a value depending on the level. You can make an array for that. But you can also make 1 object, lets call it 'LevelDirector'. Make it global. And bring 1 in each level. Now if you work with factors, its pretty easy. Bring those in instance variables on 'LevelDirector'.

    By example. The enemys range in level 2 is twice (factor) that of in level 1. Set the variable LevelDirector.RangeFactor in level one = 1. In level 2 = 2, in the properties for that object on the left, in the layout.

    Now this is always true, on each level, in every eventsheet.

    Enemy.range = Enemy.BaseRange * LevelDirector.RangeFactor

    1 line to update for the new level.

    Hope you understand what i try to say.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Newly created objects land in front of all the other objects on the same layer. All objects on layers above the spawn-layer show in front. Z-order is the order of objects on a specific layer. But also the layers have a (kinda) Z-order. Layer on top shows in front.

    So, first, you got to create them on the right layer. The create action will ask you the layer. And that layer has to be on the right place in the layers list.

    Secondly, if you want the newly created object behind an existing object, then yes you have to adjust the Z-order. But that is only possible for objects on the same layer.

  • He said that he wanted it to fall when colliding with the decor.

    So, you got to handle 'the fall' and 'the push-out-of-solids'.

    The fall (gravity wise) is very very easy with platform behaviour. (or physics)

    And for the other 'thing', it is absolutly neccensary to not push it into solids. Platform behaviour is made for that. (so is physics)

    But because there is allready a platform in play, i choosed platform above physics. This way the events stay in one and the same mind-world.

    The push-out-of-solids is key in this story.

  • I have still no idea what you are actual making. And therefor (without context) i mostly have no idea what you talk about.

  • The question was about the animations. Nota health.

    Here:

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

    Update with 2 lines.

    One to handle health on collission.

    One to (unnecessary) display that health.

  • Excsuse me my sceptisme, but it is not an inventory, its just a graphical representation.

  • 1 Blanc just means every tick. And for me personal,it makes things readable and collapsable to as few lines as posiiible.

    2 none

    3 To make it outstand (for me) in the event, so it catches my eye. It is an importand action in the flow. Need to see, by glancing, where idestroy it.

    4 Stick to 1 flow. If you set up booleances as a state machine, stick to it, dont sidetrack. Or in the end you lose grip.