How do I make the tank "stop" on collision?

Get help using Construct 2

Post » Sat Aug 27, 2016 9:12 pm

Message: osmanny38 can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I'm trying to make a game just like this:
http://www.oyunkolu.com/tam-ekran/2-kisilik-tank-savasi
But when the tank collide the wall, it still moves upside (I'm pressing to "go forward" button). I mean it is rubbing to the wall and not stopping. But it must stop if it is touching to the wall.
How can I do that?
B
2
Posts: 4
Reputation: 158

Post » Sat Aug 27, 2016 9:22 pm

Try and set 'time scale' to 0 for 0.5 secs. This will pause the movement.

So... (Event) Sprite > On collision with Wall - (Action) System > Set time scale to 0 (2nd Action) System > Wait 0.5 Secs (3rd Action) System > Set time scale to 1.

Every time the sprite hits a wall it will pause, then be able to move again.
B
38
S
18
G
19
Posts: 664
Reputation: 14,107

Post » Tue Aug 30, 2016 9:53 am

jeffige wrote:Try and set 'time scale' to 0 for 0.5 secs. This will pause the movement.

So... (Event) Sprite > On collision with Wall - (Action) System > Set time scale to 0 (2nd Action) System > Wait 0.5 Secs (3rd Action) System > Set time scale to 1.

Every time the sprite hits a wall it will pause, then be able to move again.


When using Car behavior, the game pauses at collision, but it doesn't play again.
I'm using Sprite's actions (move forward, rotate cw etc.) instead of using behaviors in order to make the tank able to rotate when not going; and adding 8 Direction behavior and disabling default controls in order to collide with solids. In this situation, there's nothing changed. It's still not stopping.

Thanks for your good answer, but unfortunately it doesn't work for me.
B
2
Posts: 4
Reputation: 158

Post » Tue Aug 30, 2016 5:25 pm

Add event, on overlap wall set speed to 0.
Mistakes were made.
B
49
S
24
G
107
Posts: 1,581
Reputation: 60,303


Return to How do I....?

Who is online

Users browsing this forum: mikehive, plinkie, sublimate, Yahoo [Bot] and 6 guests