Character movement on path with branches

Get help using Construct 2

Post » Thu Jul 18, 2013 11:02 pm

To clarify it at the very beginning, I searched the forum, but didn't find proper answer to my question. (although, there is a possibility that I missed it)

I want to achieve the effect that the player moves along a predefined path on the board and the path may have branches. The player controls the character by clicking the mouse anywhere on the screen, indicating only the direction of movement. I have no plans to do many branches with similar angles so the method of forcing the player to follow path and chose approximate direction from few options would be more then enough.

Additional explanation:


Is it even possible in C2? I'm interested in ideas, solutions as well as any workarounds. Basically any kind of help is appreciated.

May only reasonable idea:
szawe2013-07-18 23:37:57
B
3
Posts: 3
Reputation: 183

Post » Fri Jul 19, 2013 12:40 am

Have pathfinding setup, and assign each path as invisible obstacles. Also fill the areas between the paths with solid objects (visible or not) so that the paths are the only way to go. Have large invisible sprites that cover each area you want the user to click to indicate the path to take. When the user touches or clicks on the invisible sprites, have it destroy or change the state of the invisible sprites that are blocking the path. Then pathfinding will have only one way to go and that will be along the path with no obstacles.

Just a thought off the top of my head but in theory it should work.
B
49
S
12
G
10
Posts: 1,833
Reputation: 14,583

Post » Fri Jul 19, 2013 9:37 am

[QUOTE=BluePhaze] Have pathfinding setup, and assign each path as invisible obstacles. Also fill the areas between the paths with solid objects (visible or not) so that the paths are the only way to go. Have large invisible sprites that cover each area you want the user to click to indicate the path to take. When the user touches or clicks on the invisible sprites, have it destroy or change the state of the invisible sprites that are blocking the path. Then pathfinding will have only one way to go and that will be along the path with no obstacles.

Just a thought off the top of my head but in theory it should work.[/QUOTE]

What a terrifying idea, but I guess it may work, thanks. Just hope it will not turn against me like Frankenstein's monster.

Does someone know any other solution?

Is it possible in C2 to create such paths for player movement?

Do provided method for creating paths (assuming there is one) will let me find the points of intersection of them and the perpendicular line going through space mouse click point?

Can I create a tree structure to represent paths inside game logic? (tree representation should be fine for my design and it may make traversal a bit faster and simpler since it will be easy to check if to search up or down the tree)

But perhaps maybe there is some method to create paths and calculate the direction from the angles?szawe2013-07-19 10:13:17
B
3
Posts: 3
Reputation: 183

Post » Tue Jul 30, 2013 10:06 am

I'm stuck on this, it seems that I will have to redesign my game.
B
3
Posts: 3
Reputation: 183

Post » Tue Jul 30, 2013 10:25 am

To do this you'd have to accomplish this:

- Restrict the player's movement, so he can only move from active waypoint to active waypoint.
- If player is over waypoint set all connected waypoints to active.
- find active waypoint closest to mouseclick.
- set player movement in direction of closest active waypoint.
- if player moving along path only set waypoints connected to path as active.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: lukewasthefish and 11 guests