How do I trigger the player to stop automatic after a predef

Get help using Construct 2

Post » Thu Feb 19, 2015 12:30 pm

Hi, first sorry for my english but its not the best:)

I have a problem with my project. My Player moves with bullet behavior, if the gamer is swiping (left or right) the bullet behavior gets activated and the player moves to certain direction. How do i trigger the player to stop automatic after a predefined distance ??
B
4
Posts: 4
Reputation: 208

Post » Fri Feb 20, 2015 12:23 am

Compare the player x then set the speed to 0

It's better that you try the MoveTo behavior, search for it in the plugins forum section.
Image
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Fri Feb 20, 2015 12:49 am

in Bullet Behavior there is value called DistanceTravelled

Reference it like this:

System (compare two values) Sprite.Bullet.DistanceTravelled > 400 then do whatever

and make sure to place a System -Trigger Once While True so you don't keep triggering the same code since once that statement is true it will execute once every tick (60 times per second!).
B
88
S
29
G
14
Posts: 1,154
Reputation: 15,003

Post » Fri Feb 20, 2015 6:56 am

thanks for the replys, i will try
B
4
Posts: 4
Reputation: 208

Post » Fri Feb 20, 2015 7:46 am

MoveTo behavior works perfectly...thx for the tip
B
4
Posts: 4
Reputation: 208


Return to How do I....?

Who is online

Users browsing this forum: vegapomme27 and 7 guests