[SOLVED]Make an object move through a fixed and random track

Get help using Construct 2

Post » Fri Jun 05, 2015 12:47 am

Hi C2 developers! ^^

I would like to hear from you what is the best way to make an object not controlled by the player move linearly through a predetermined track.

I managed to do here through waypoints together with the MoveTo behavior, but it's not perfect, because I need that to move objects in a perfect line between the waypoints without small deviations. It is worth mentioning that my game uses isometric perspective (30 degrees), then the difficulty is greater. Furthermore, there are waypoints in stage 5 to move the object from point A to B.

HOW TO IMPLEMENT THE RANDOM TRACK?

Now I'm trying to implement an alternative random paths system to a game based on the simple_path_follow.capx posted in this thread by @R0J0hound.

https://dl.dropboxusercontent.com/u/542 ... ollow.capx

I'm trying to do this:
Image

I believe that the right way to do this is by identifying the black circles through UID, but I cannot implement it. For this, I left the black dots that make up the parallel paths with equal values in the variable "n".

So I tried (unsuccessfully) to do their own event to redirect the avatar, making the following changes:

Object move at angle: move min(Self.speed*dt, Self.dist2target) pixels at angle angle(self.X,Self.Y,Dot(choose(30,31)).X,Dot(choose(30,31)).Y)

Object subtract from: subtract Self.speed*dt from dist2target

EDIT:

RANDOM TRACKS SYSTEM IMPLEMENTED BY @blackhornet, through LiteTween. :D

http://www.blackhornettechnologies.com/ ... k_BHT.capx

LiteTween: viewtopic.php?t=70700&start=0

Thanks in advance the attention and collaboration of all. ^^
Last edited by lukezero on Wed Jul 22, 2015 8:23 pm, edited 16 times in total.
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 10:57 am

Master @R0J0hound, can you help this padawan here? ^^
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 11:40 am

Can you give a picture of your game? Its would be easier to understand what you need.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Fri Jun 05, 2015 12:43 pm

Sure, @XpMonster. ^^
Last edited by lukezero on Sat Jun 06, 2015 1:00 pm, edited 1 time in total.
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 12:45 pm

These black dots in the track are the waypoints that the kid (out of the grid) gonna follow in this stage.

As I said before, I'm using MoveTo now to do the track movement, but it isn't perfect. Maybe its a collision problem, I don't know.
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 12:50 pm

So, hero can walk only through points?

I think this might help in this case, my last message - https://www.scirra.com/forum/viewtopic.php?f=147&t=147611&p=938715#p938715

Look at the enemies.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Fri Jun 05, 2015 1:13 pm

Exactly, @XpMonster. :)

Your CAPX is a good exemple and a good job, but I need something more specific, due to the format of my game.

Thanks for your collaboration. ^^
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 1:23 pm

Well, you'll still have to use "pathfinding" behavior. Just in a different way, 'cause i see - you want your player move by the grid.

It's seems simple (But that is always like that 'til you get to it), so i'll try figure something out, but cannot promise anything.

And i need exact size of your grid.
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Post » Fri Jun 05, 2015 1:33 pm

Thanks one more time, XpMonster. ^^

The image size of the Grid is 816x473.
B
38
S
9
G
3
Posts: 258
Reputation: 4,324

Post » Fri Jun 05, 2015 1:36 pm

Not in total. Just one block - Image
I'm a Magician, not a Developer.
B
22
S
8
G
25
Posts: 106
Reputation: 14,294

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo, David181, fens, Google [Bot], Piggly and 15 guests