How do I ... transfer drag speed to a bullet

Get help using Construct 2

Post » Mon May 01, 2017 1:13 pm

I have a touch game. There are two objects (object1, object2) that a player can drag around on the screen. They can be moved at the same time. The player touches either or both objects and drags them around. (I'm using the touch area and then binding the object to a touch area method for this).

When either object collides with a bullet, there is a collision.

I want to the speed that the object is being dragged to transfer to the bullet. If object1 is being moved slowly, when the bullet collides with it, the bullet should bounce off slowly.

I can't figure out how to get the speed of object1 or object2. I've tried adding a bullet behavior to them. I've thought about calculating speed every 200 milliseconds using the distance but that seems cumbersome and unreliable.

Does anyone know how to get the speed or acceleration of a drag/drop object?
Posts: 1
Reputation: 377

Post » Mon May 01, 2017 1:51 pm

You will probably find you will need to calculate it yourself using the speed=distance/time formula and transfer that to a variable to set bullet speed by.
Check out my completed games on the Arcade! Capt. Doe Save the Universe! & Clicker Wizard!
Posts: 664
Reputation: 10,333

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 12 guests