Drawing with instances

0 favourites
  • 5 posts
From the Asset Store
You need this package if you want to program a Street Fighter or battle game.
  • Hi guys, Instances is a weak spot of mine <img src="smileys/smiley6.gif" border="0" align="middle">

    I need to draw a lined from each instance to the next. I tried a for each event. But nothing happened.   

    Here is my capx: capx

    And here is a little image i done showing what im trying to achieve: Image

    Thanks.

    ps, I know the way I code may look a little weird. Oh and im working on the arcade layout right now, not level 1.

  • When you tackle this kind of problem you have to list what the system has to know and what it can deduce.

    For instance, how the system knows which instance to link which each other instance?

    I mean. if you have 4 dots, there's many ways to link them.

    In your picture it seems an instance will always be linked to the same two others.

    So, how can you tell the system how to link them?

    I think you can use an instance variable named 'order' that will hold maybe the order your object were created

    so you can create lines from the first to the second, etc etc.

  • Yann,

    Im not entirely sure how the system should know, like you suggested a instance variable with a order would make allot of sense..

    I Basically need to be able to drag all of the instances around the stage, The line will connect all four of them. If the line is over all four targets then level complete.

    The user has to be able to position the line between all of the targets to win,

    Does that help?

  • Boy, this was a toughy...

    ....here's your new CAPX

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks!! Really saved my day :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)