How do I make the motion of Bullet change?

  • Hi guys. I need help with the motion of Bullet.

    In my game, I change the movement of player by adding a Bullet for the player sprite and changing the angle. But I only can stop the movement of bullet by layout. Could I add some sprites to stop them, if the sprites can go back after crashing the sprites (moving in an opposite direction), it should be better.

    In short, could I make the barriers to stop the movement of bullet?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You would simply add a sprite and add an event

    "Player: On collision with [Sprite] --> Player: Bullet: Set speed to 0".

    But I have a question though:

    why would you use bullet for the player movement?

    Why wouldn't you use "platform", "custom movement" or "8 direction"?

  • Thanks for your help. But it still does not work.

    I want to keep the player moving, and when I slip the screen, its direction of movement will be changed.

    If I set the speed to 0, the player will not keep moving.

  • So you want to this?

    • when you swipe right, the player moves to the right
    • when you swipe left, he moves to the left
    • when you swipe in any direction while he is moving, he changes directions?
  • Yes. This is what I want.

  • Alright, assuming you don't help with the swipe input, this is what you do:

    On right swipe:

    On left swipe:

    (Replace 300 by the speed you want. Alternatively, replace the whole "set speed" to "set acceleration", if you don't want immediate movement)

  • Thanks, I'll try it.

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