Yann's Recent Forum Activity

  • event 5 should be something like

    "Publish score myScore"

    where 'myScore' would be the global number you use to keep track of score during the game

    I never made any facebook game so I can't be sure but, to me, that's the only weird part of your code.

  • event 5 -> "Publish score 0" ?? o_o

  • global number x = [insert the starting X position]
    global number y = [insert the starting Y position]
    On start of frame
      -> player: set X to x
      -> player: set Y to y
    On entering a bulding
      -> set x to player.x
      -> set y to player.y
      -> go to layout building
  • fadeBug.capx

    you were restarting the fade every tick while the mouse was over the column, so it got stuck at the start of the fading

  • capx

    capx for touch

    You can set min and max value in instance variable of sld_line object.

    As well as a snapped boolean if you want your slider to snap on rounded values.

    The sliders now use container to associate the button, the line and the eventual textbox object.

  • if you read it,

    if background = 0 set background to 1

    and then event 3 is true and it goes back to 0

    So both event happens.

    Also local variable are reset to there default value every time you read the subevent part they are into.

    Your solution is to use a global variable, not a local. Just drag the declaration just before event 1.

    And then event 1 before your subevents just do a

    System: set background to 1-background

    It will toggle between 0 and 1

  • fun to do

    animatedGradient.capx

  • In your attempt you don't filter specific instances of ObjectB

    so the distance check will be true as soon as there's an ObjectB close...

    Also System expression doesn't filter the SOL.

    So it will change all the overlap variable of all instances of ObjectB

  • +System: every tick
      -> ObjectB: set Overlap to 0
    +System: foreach ObjectB
      +System: foreach ObjectA
        Local variable else = 1
        +System: distance(ObjectA.X,ObjectA.Y,ObjectB.X,ObjectB.Y <= 300)
          ->ObjectB: Add 1 to Overlap
          ->System: set else to 0
        +System: else = 1
        +ObjectA is overlaping Radius
          ->ObjectB: Add 1 to Overlap[/code:14n7r9sb]
    
    There's only one issue
    The radius sprite... how do you associate it to each ObjectB ?
  • 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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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)

Yann's avatar

Yann

Member since 31 Dec, 2010

Twitter
Yann has 5 followers

Connect with Yann