Here's a hard one...

For questions about using Classic.

Post » Sun Apr 25, 2010 10:54 pm

Is it possible (and if it is, how can it be done?) to have an object follow a line created by the mouse, or perhaps trace the movement of the character? So, you could have things moving in loopty-loops, or following a path previously created by a character?

In basic terms, kind of a replay, where the objects follow the same way they moved/pointed/shot earlyer? I'm having a hard time doing this as I don't fully understand hash tables and arrays, which I think are somehow involved in this effect. Any help would be greatly appreciated.
B
2
G
3
Posts: 23
Reputation: 896

Post » Mon Apr 26, 2010 4:43 am

Here's an example:
[url:3crvio9c]http://www.scirra.com/forum/viewtopic.php?f=16&t=5962[/url:3crvio9c]
Using this behavior:
[url:3crvio9c]http://www.scirra.com/forum/viewtopic.php?f=2&t=5693[/url:3crvio9c]
Image Image
B
161
S
48
G
91
Posts: 7,359
Reputation: 67,273

Post » Mon Apr 26, 2010 2:02 pm

[quote:gypw474j]following a path previously created by a character?[/quote:gypw474j]

you mean you want to give "time reverse" like feature??

here's an example:

http://dl.dropbox.com/u/5811650/Help%20 ... everse.cap

use arrow keys to move, SHIFT to jump and 'R' to trace the player's movement.
this is already done in some thread but I can't find that right now....
this example was first done by deadeye, but for some reason his example didn't work on my computer(probably due to different versions of construct) so I made another example using his idea as a base
B
9
S
3
G
3
Posts: 366
Reputation: 2,301

Post » Tue Apr 27, 2010 6:22 pm

I think this person want a replay feature not a time reverse feature.
B
21
S
4
G
4
Posts: 280
Reputation: 2,934

Post » Wed Apr 28, 2010 6:39 am

There was example here that used listbox to store all the x,y(could add states like shooting etc), but the link is gone, altho I think I have it on a pc somewhere or someone may have posted old example in uploads. However, this way is not very efficient but you can use short cuts like interpolation, getting the speed and angle of motion, and only adding new values when something changes.
B
2
S
2
G
4
Posts: 259
Reputation: 1,968


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 0 guests