Connecting instances with lines

0 favourites
  • 7 posts
From the Asset Store
solution for games like "fruit ninja" and drawing applications
  • ConnectNodes.capx

    I have a bunch of nodes on a layout, and I would like to connect each with a line to all the other nodes

    But for the moment they all converge to a single node for some reason

    Having hard times figuring out the right "picking" setup I guess...

    Any tips appreciated

    Thx

  • This was a challenge!

    ConnectNodes_answer.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • blackhornet

    Thanks, works great!

    Now I have a new challenge if you like ;)

    You may have seen that the nodes had a drag and drop behavior

    Ideally I would like the lines to follow while dragging any nodes if doable

  • Okay I figured out how to add it to your code

    Just wanted to make sure everything was redrawn only while dragging, otherwise the framerate was going nuts

    Also I added a minimal distance check and a right-click to add nodes ^^

    ConnectNodesDrag.capx

    I'm leaving the challenge open though if someone manage to do all this with less events!

  • I was testing random stuff

    So here is a happy rainbow kinda thingie!

    <img src="http://i.imgur.com/lHApfhx.png" border="0">

    HappyRainbow.capx

    Actually the rainbow is animated and flows to the right nicely

    This uses the Tiled Sprite plugin

    I'm not sure I'll use this for my project because the fps are dropping fast with many nodes, but it could be super handy to create all kind of moving things, escalators, hydraulic pipes, tank tracks, conveyor belts...

  • I was testing random stuff

    So here is a happy rainbow kinda thingie!

    HappyRainbow.capx

    Actually the rainbow is animated and flows to the right nicely

    This uses the Tiled Sprite plugin

    I'm not sure I'll use this for my project because the fps are dropping fast with many nodes, but it could be super handy to create all kind of moving things, escalators, hydraulic pipes, tank tracks, conveyor belts...lemo2013-02-19 06:18:02

    Plugin is located here...

  • Carbincopy there is working link to dropbox in last message

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