How do I make the motion of Bullet change?

Get help using Construct 2

Post » Fri Nov 25, 2016 4:09 pm

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?
B
10
S
1
Posts: 6
Reputation: 462

Post » Fri Nov 25, 2016 7:22 pm

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"?
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Sat Nov 26, 2016 2:38 pm

[quote="randomly"]

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.
B
10
S
1
Posts: 6
Reputation: 462

Post » Sat Nov 26, 2016 4:16 pm

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?
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Sun Nov 27, 2016 1:25 am

Yes. This is what I want.
B
10
S
1
Posts: 6
Reputation: 462

Post » Sun Nov 27, 2016 4:47 pm

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

On right swipe:
Image

On left swipe:
Image

(Replace 300 by the speed you want. Alternatively, replace the whole "set speed" to "set acceleration", if you don't want immediate movement)
"We can't solve problems by using the same kind of thinking we used when we created them."
- Albert Einstein
B
27
S
11
G
8
Posts: 528
Reputation: 7,091

Post » Mon Nov 28, 2016 2:22 am

Thanks, I'll try it.
B
10
S
1
Posts: 6
Reputation: 462


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests