How do I make lanes work?

Get help using Construct 2

Post » Sun Mar 25, 2012 9:53 pm

I have this as my 'game' from what I can see the events are the same for right and left; but going right (from the left to the middle) doesn't work. What's going on here?
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Sun Mar 25, 2012 11:54 pm

If you change the order of the two sub-event conditions it works.

The problem you have is that when char's X=60 clicking on the right arrow moves char to x=160, but then, surprise! The next condition is true too, so char is immediately going to 260.

By changing the order if char's x=60, the condition of the first sub-event isn't true, so it goes to the second sub-event and moves char to x=160 and then exits the event.

kittiewan2012-03-25 23:57:11
B
29
S
11
G
12
Posts: 281
Reputation: 11,878

Post » Mon Mar 26, 2012 12:01 am

Also, when adding a bullet behavior to the char sprite the buttons no longer work, I can't see the problem in this..
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Mon Mar 26, 2012 12:24 am

Are you using the bullet behavior for anything other than crawling up the screen?

If not, you can just decrease char's y every tick instead of using the bullet behavior.

System -> Every Tick      char set y=self.y - 1

To make char move faster subtract a bigger number; to make it slower subtrace a smaller number.kittiewan2012-03-26 00:25:36
B
29
S
11
G
12
Posts: 281
Reputation: 11,878

Post » Mon Mar 26, 2012 12:39 am

Thank you, that works fine. May I still ask what the problem was with the bullet behavior? I'm just curious..
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,383

Post » Mon Mar 26, 2012 4:00 am

I honestly have no idea. I suspect it is intended to be set on a trajectory and continue on it unless the trajectory is reset, but I could be wrong about that. I haven't used bullet except for enemies, and in one case where I redirected the bullet's angle based on mouse clicks. I used the other way for climbing ladders in a platformer and knew it would allow a change in X as the Y changed.

If char has a bullet behavior you could change char.bullet.angleofmotion when the arrows are clicked and the
char would look like it was changing lanes gradually.

Something like:

char -> set bullet angle of motion to clamp(self.BulletAngleOfMotion - 10, -110,-70) degrees

for the left arrow and

char -> set bullet angle of motion to clamp(self.BulletAngleOfMotion + 10, -110,-70) degrees

for the right arrow.

I don't think that's what you're looking for, though.
B
29
S
11
G
12
Posts: 281
Reputation: 11,878


Return to How do I....?

Who is online

Users browsing this forum: randomly, Walessio and 23 guests