Is there any way to make a player move towards the clicked object from the multiple objects present on screen and bounce upon collision? I am trying to make a very fun game but am stuck here.
Another thing I want to ask that is there any way to make my player follow the cursor of the mouse?
You could drag a target sprite around the screen and have the players character follow or face towards that target sprite.
This would achieve the same result as following the mouse cursor.
You can also code,"" When a class member senses pressed,
Do affected class member, face towards target sprite, add relative force fowards ???""
Yes, you can try use the “Move towards” behavior, select the “Bounce” material in the appearance tab and turn on the physics for the player, event example:
(Event1)
Object1/Sensing/Touch Down
Player/Move Towards/Set Target/Object1
Player/Move Towards/Set Active/Yes
(Event2)
Object1/Sensing/Collided With Object/Player
Player/Move Towards/Set Active/No
Yes, you can add another object to the scene and use "Last Touch’ position in the events, for example:
System/Listener/Touch Down
Target/Position/Set Position/Last Touch Coordination
Player/Move Towards/Set Target/Target