Yann's Forum Posts

  • Yes you can

  • just keep a gloabal variable called 'lastCar' and everytime you spawn a new 'train' set this variable to train.UID

    then

    +train.UID = lastCar

    +train.X+train.Width/2 < windowidth+50

       -> spawn a new train

       -> lastCar = train.UID

  • Also during dev, it happens that you make 2 really different objects.

    That never shares any kind of behavior or aren't close enough to justify any blending.

    But one day you discover that you begin to copy paste many identical stuff. Like if you want to destroy a bunch of sprite on game over or because of a brand new feature you just added that spawn a nuclear warhead that destroy everything within a certain range (decor tiles, enemy and pickup sprites) here family come really handy. You just have to create a 'destroyable' family and test for distance or invisible radius sprite overlap.

    The other possible thing you could do is a pokemon kind of game.

    yes you could have all pokemon animation in only one object.

    But having dedicated sprite for each pokemon allows you to do something interesting : setting default parameters and some list of attack ID in variables during edit time.

    And then just drive all your pokemon with the family system.

    That's very powerfull, 'cause the work around without family would be to put all the pokemon in one pokebal... erm 'pokemon' sprite :D

    And then have a CSV string for default properties of each pokemon.

    Pretty painfull to maintain. You'll have to keep track of which line match which pokemon.

    Ashely

    Anyway, I might be wrong, but there's still on thing in this design that work better with one sprite instead of family: a random creation system.

    It would be intersting to be able to do a

    System: create pokemon[floor(random(pokemon.ObjecttypCount))]

    to spawn random pokemon in the overworld.

    Well you could have just a little sprite with all the pokemon for the overworld display and do a set frame to random(animationframecount)

    But then you'll still have to be able to call a specific objecttype within the family.

    So yeah objecttype index and object creation using expression could be a plus.

    Edit: Just saw that Creating family creates a random object from the family. But still, having an index could be interesting for weighted randomness or if we want to match some stuff to the order of the objecttype in the family (like a 'thumbnail' family would relate to a 'photo' family by the order of their member)

  • also things like that are easier to do with families

    closeDetection.capx

    With family you can more easily filter 2 instances of the same object type and always know in expression which is which.

    You filter the first one with the objecttype name, the other one with the family name and you can do complicated operation between them.

    Without family it's still possible but you would have to do that in more convoluted ways.

  • maybe you don't have the same layer structure.

    look at event 8 and check if Layer 2 is the proper layer

  • harrio

    hehe too bad, I don't drink alcohol (:

  • next time, try lemonade with grenadine syrup. That's better :D

  • I think it won't. Well it's not very hard to check that, just instead of setting a variable set some random size and you'll see if all the already created object are affected or not.

    To simulate picking you could set a boolean named 'picked' to true on creation inside the function, and then add a "is picked" after the call to set your value and directly set this boolean to false to somehow lock it.

  • when I suggested canvas, I though you were also using your tileMap for background stuff like in niffla's knytt and knytt stories.

    So I thought you will spawn an entire grid of sprite.

    But as you said earlier, you just want to spawn some platform, ennemies and pickup. For that you shouldn't use canvas.

    Also newt was just suggesting using an image based map system... (it's one of his recurring obsession :D)

  • Create another project and put an array in it, then save it as project and look at how the xml is made.

    You then just have to mimic the syntaxe

  • didn't know drag&drop behavior worked on touch devices... nice (:

  • yeah the array aren't in your layout

    You have to save you're game as project and go into your layout xml to add the array back in it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Well, even if it's not super fast as it could be, it I observed better performances with webGL than without it. That was mostly why I did add this modification.