Make actor accelerate in opposite direction with collision
iPhoneDevForMe
Member Posts: 362
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!!
I have tried a few things and just cant figure it out. Thanks in advance!!
Comments
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.
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?