How to automatically draw lines that will work as paths

Get help using Construct 2

Post » Sun Aug 09, 2015 8:31 pm

In my game I want my code to generate random paths for an object to follow. The path should always go downwards, but occasionally divide into separate paths for the player to select.

I have tried several approaches without luck, so I'm simply asking for a way to make this work best way possible. Only thing I can come up with is a tick loop that adds pixel by pixel, but I guess that would be a terrible way to do it?
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Post » Mon Aug 10, 2015 7:28 pm

Are you doing some kind of vertical scroller? Do these paths need to be contiguous?

I've never worked with the Pathfinder object, but I can suggest mathematical ways to do this if you are interested.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Mon Aug 10, 2015 8:32 pm

@gumshoe2029 I don't think I'll need pathfinding for now. Just drawing lines vertically and occasionally split into two ways. I almost made a solution with bullet behaviour that shoot out lines, but now only got one vertical line. I might get this working, but I'm definitely open for better solutions.
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Post » Wed Aug 12, 2015 8:52 pm

Nice, put your solution here if you get it working. Thanks.
https://www.ravenheart.ca/home
I don't check the forums much anymore, but I will receive an email for PMs.

"Someone once told me I bite off more than I can chew...

I told them I would rather choke on greatness than nibble on mediocrity."
B
23
S
6
G
1
Posts: 1,419
Reputation: 4,857

Post » Wed Aug 12, 2015 9:58 pm

@janlindso
If I understand, you can simulate this by moving your object from A to B when angleAB=180° and AB is perpendicular to X axis
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Thu Aug 13, 2015 3:39 pm

Still having a hard time to find a solution for this. Tried to make an animation to show what I want to create.
Image

- A sprite moving along a line (really in same position all the time)
- If left button is pressed, then move to the left path
- If right button is pressed, then move to the right path

Have tried to do it with a line sprite shooting out bullets to create the path, but there must be a better way to do this?
Last edited by janlindso on Thu Aug 13, 2015 4:26 pm, edited 1 time in total.
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Post » Thu Aug 13, 2015 4:14 pm

I don't know if this is what you searching for, but I think it can be helpful. It's a @blackhornet job, did with the LineTween plugin. ^^

CAPX:

http://s000.tinyupload.com/index.php?fi ... 4777992425
B
39
S
9
G
3
Posts: 261
Reputation: 4,361

Post » Thu Aug 13, 2015 7:18 pm

lukezero wrote:I don't know if this is what you searching for, but I think it can be helpful. It's a @blackhornet job, did with the LineTween plugin. ^^

CAPX:

http://s000.tinyupload.com/index.php?fi ... 4777992425


Thanks. It's pretty close, but still not it. This one makes the object move along the lines. I want the object to be at the same spot all the time, so I guess it must be the paths that moves and not the object itself.
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Post » Thu Aug 13, 2015 7:25 pm

Something like this ?
(left/right arrow to change direction)

EDIT: link broken see next post
Last edited by MadSpy on Thu Aug 13, 2015 8:53 pm, edited 1 time in total.
Image Image
B
25
S
14
G
139
Posts: 876
Reputation: 72,510

Post » Thu Aug 13, 2015 8:41 pm

MadSpy wrote:Something like this ?
(left/right arrow to change direction)


Maybe, if only I'd get the link to work. :)
Image
B
14
S
4
Posts: 145
Reputation: 1,948

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, Syazanie Amirin and 9 guests