How to make actor bounces of when you touch it?
So i want to know how to make actor that will bounce of in opposite direction when i touch it...
here is the example
Than you very much!
here is the example
Than you very much!
Comments
In direction i've put an expression random(20,160) and it almost works
It's doing the thing i wanted, it bounces of when i touch the screen but because of the random expression it bounces in random ways between 20 and 160 degrees upwards.
So can anybody tell me what expression should I use to get accurate direction ??
I've forgot to put an example picture in last post....
http://imageshack.us/photo/my-images/259/53968434.jpg/
So I just want to say thank you very much, that was what I was looking for
P.S. Can you tell me please how to make that actor goes just upwards when you touch on it. somewhere between 10 and 170 degrees.
So something like that but you can't catapult it downwards
Thank you very much
vectorToAngle(self.position.x - game.mouse.position.x , self.position.y - game.mouse.position.y + self.position.y)
now the only thing is everything works great when actor is on the floor,
but when it's on a higher ground (platform) above the half of the screen it doesn't work that well.
The angle of traveling actor is much smaller...you'll get it when you see the pictures below
On the ground: http://imageshack.us/photo/my-images/535/11045609.jpg/
On the platform: http://imageshack.us/photo/my-images/593/76155749.jpg/
Thank you soo much
thank you very much
with all off this the upper half of actor doesnt react to touch, and i want that the whole actor reacts to touch...
so i've tried with 2 rules one for the upper half and one for the lower half, it sortof works correctly but allmost every time when i touch the upper half of the actor, actor immediately goes up then the lower part reacts with touch and it changes direction (the second rule is activated)
how can i fix this