How do I make lanes work?

0 favourites
  • 6 posts
  • 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?

  • 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.

  • Also, when adding a bullet behavior to the char sprite the buttons no longer work, I can't see the problem in this..

  • 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.

  • Thank you, that works fine. May I still ask what the problem was with the bullet behavior? I'm just curious..

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)