shinkan's Recent Forum Activity

  • I think the instance variables are all set to 0 when the object is spawned and that's why all spawn on the same spot and with the same color ...

    I could be wrong ...

    Try positionning them out of the layout , and just moving them

    That is correct.

  • I don't think You can.

    one of the solution would be to specify somewhere all attributes for variables

    Family1.id = 1 - > set Color = "blue"

                       set PosX = "123"

                       set PosY = "321"

    Family1.id = 2 - > set Color = "red"

                       set PosX = "567"

                       set PosY = "765"

    ...

    That way family objects with corresponding id number will always have this values.

    I'm not at home at the moment so I can't check for other possibilities.

  • It won't work like this because you are creating sprites with

    Color = ""

    PosX = ""

    PosY = ""

    ID = ""

    In your example you are refering to sprites from different layout. But on your current layout Sprite1 have all variables set to "".

  • Try if this will position them properly

    +System -> On start of layout

    System -> Create object Heroes on layer 0 at (LayoutCenter.X -100, LayoutCenter.Y -100)

    System -> Create object txtName on layer 1 (Heroes.X, Heroes.Y)

    txtName -> Pin Pin to Heroes(Position & angle)

    txtName -> Set position to Heroes(image point 1)

    System -> Create object Heroes on layer 0 at (Heroes.X + 60,Heroes.Y)

    System -> Create object txtName on layer 1 (Heroes.X, Heroes.Y)

    txtName -> Pin Pin to Heroes(Position & angle)

    txtName -> Set position to Heroes(image point 1)

    System -> Create object Heroes on layer 0 at (Heroes.X + 60,Heroes.Y)

    System -> Create object txtName on layer 1 (Heroes.X, Heroes.Y)

    txtName -> Pin Pin to Heroes(Position & angle)

    txtName -> Set position to Heroes(image point 1)

    Basically create hero first and right after that create txtName.

    If that works (which it should!) it means you got something wrong with your events

    edit: just noticed, you dont need to set it like that

    System -> Create object txtName on layer 1 (Heroes.X, Heroes.Y)

    txtName -> Pin Pin to Heroes(Position & angle)

    txtName -> Set position to Heroes(image point 1)

    There's no need to set position twice, instead you can use:

    System -> Create object txtName on layer 1 (Heroes.ImagePointX(ImagePoint), Heroes.ImagePointY(ImagePoint))

    txtName -> Pin Pin to Heroes(Position & angle)

  • Did you try lerp(a,b,x)?

    lerp(sprite1.X, Sprite2.X, 0.5) shoud put your sprite between

    file.capx

  • There is no need to use dt for that because you want to set it's position once (to self.y - 1080) - not move to position (by dt).

    So if Tile_bg have reached target (Y>960+Tiles_Bg.Height/2) then it will jump to self.Y -1080.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • shinkan - appreciate the example, i was wondering if you wouldn't mind answering a question?

    if so:

    - your bg scrolls using dt but isn't reset using dt (as far as i can tell), is the tiled background somehow accounting for dt?

    (your obstacles don't appear to spawn stacked or in a row which is why i'm asking about the background <img src="smileys/smiley1.gif" border="0" align="middle" />)

    What do you mean "isn't reset using dt"?

  • Trench Run

    Maybe something like this? An old capx i've made.

    It's vertical, but can be easily modified to horizontal - and no gaps ;)

  • You need to specify to which family instance you want change/do something.

    For example. If you set family text variable called "name"

    and you set that variable for all sprites in this family to

    sprite1.name = "john"

    sprite2.name = "ben"

    etc...

    you can pick any instance you want by "calling" their name.

    +family.name = "ben" - do something for this instance only

    +family.name = "john" - do something for this instance only

  • example.capx

    It would be much better if You could create objects by name in expressions... but still it's working fine.

  • There's many ways to do this.

    You could make a layout with picture and then if you press enter go to next layout with your game events.

shinkan's avatar

shinkan

Early Adopter

Member since 21 Nov, 2008

Twitter
shinkan has 8 followers

Connect with shinkan

Trophy Case

  • 16-Year Club
  • x5
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • Enduring Visitor Visited Construct.net 90 days in a row
  • Unrelenting Visitor Visited Construct.net 180 days in a row
  • Continuous Visitor Visited Construct.net 365 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

25/44
How to earn trophies