Make actor accelerate in opposite direction with collision

iPhoneDevForMeiPhoneDevForMe Member Posts: 362
edited November -1 in Working with GS (Mac)
How would I set it up so that when an actor collides with an object it will accelerate in the opposite direction? If possible, the faster it is going the faster it will accelerate in the opposite direction.

I have tried a few things and just cant figure it out. Thanks in advance!!

Comments

  • sebmacflysebmacfly Member Posts: 1,018
    Double clic on your actor and in the attributes/Physics, enter a big restitution (2 for exemple)
  • iPhoneDevForMeiPhoneDevForMe Member Posts: 362
    Thanks for the reply! I am actually making a air hockey type game, so im looking for a way to have the puck move around when hit with the players pad? Thats the movement im looking for, any ideas?
  • synthesissynthesis Member Posts: 1,693
    Also check your drag value. Less drag will allow the acceleration to happen faster.
    Also...
    You can always add a "change velocity" behavior prior to the acceleration behavior after the collision occurs (like a turbo boost)...but you would need to know the direction first...which will require some math.

    I think you are going to need to get into a lot of trig algorithms to get very "fancy" with your game concept. Table games such as this (ie, billiards, tennis, hockey, etc)...if you are looking to do anything advanced with the game...will require quite a bit of trigonometry (and geometry) to be able to manipulate values of actor elements on the fly...since so much of it is structured around angles of action and reaction...combined with acceleration and velocity.
  • sebmacflysebmacfly Member Posts: 1,018
    I have a question lol...
    I have an actor moving fro mleft to right, if i hit it, he go away with collide... and i don't want that.. if i hit it, my first actor have to move, not the actor moving...
    What i have to do?
Sign In or Register to comment.