Move towards and Bounce

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?

4 Likes

Are you trying to make a game like snooker?

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 ???""

3 Likes

No @Suzzy-Grey it is in no sense similar to snooker. However, thanks for the help

3 Likes

Hi @samsajwani1234!

  1. 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
  1. 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
3 Likes

Thanks @Ready. Hope this might help

4 Likes