event fires only once

Get help using Construct 2

Post » Thu Jun 09, 2016 1:25 am

In my game I have a enemy character, a Roc, that flies back and forth across the screen. I have an invisible line drawn down the center of the screen and an event attached to that line. When the Roc hits the line, for now, it is directed to move to the other side of the screen. Which it does. Another event on a line on the opposite side of the screen directs the character back to the center. The event should fire again and send the roc over to the other side of the screen.
The purpose of the line is that when I have this working, the roc will be doing other things should certain conditions arise.

Here's the link to my project. https://www.dropbox.com/s/0e14dnd4wgb0efn/Uru.capx?dl=0

Thanks.
B
16
S
7
Posts: 46
Reputation: 1,344

Post » Fri Jun 10, 2016 11:39 pm

You should look at using a time-based sinusoidal curve for the Rocs position.
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 » Sat Jun 11, 2016 1:25 pm

Hmm, custom path? Yeah, maybe I should look into that. Thanks.
B
16
S
7
Posts: 46
Reputation: 1,344

Post » Sat Jun 11, 2016 4:32 pm

@beardman
just took a look at your capx, and when the Roc is flying to the left, it is never hitting the centerline, or the farleftPt. The path ends before it makes contact with the line, so it never sets a new path. Probably because of where origins are... or something like that. Also, the Roc doesn't seem to want to fly very close to the left edge of the screen.

So, I moved the farleftPt out from the edge (set its x to 25). And when finding a path to the left, I told it to subtract 50 from the x of the target to make sure it was going to hit the line: Find Path to (centerLine.X -50, centerLine.Y) or Find Path to (FarLeftPt.X -50, FarLeftPt.Y)

I didn't have to change the path finding when it was flying to the right.
After those changes it continuously flew back and forth just fine.
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Tue Jun 14, 2016 1:58 am

@AllanR.
I did just that, and it still isn't working. Weird. Not sure what I'm doing wrong. Do you happen to have a copy of that .capx you modded? Thanks.
B
16
S
7
Posts: 46
Reputation: 1,344

Post » Tue Jun 14, 2016 2:36 am

@beardman
here is the version that I modified... http://www.rieperts.com/games/forum/Uru.capx
B
99
S
35
G
20
Posts: 438
Reputation: 17,910

Post » Wed Jun 15, 2016 2:58 am

Got it. Thanks!
B
16
S
7
Posts: 46
Reputation: 1,344


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG and 8 guests