I am making a game (Who isn't?) of which needs objects to be sucked to one location. (For the game, I need people to be sucked towards a bullet. Crazy, yes, but it is a strange game...)
If someone could post an example, that would be helpful... Or if you could just e-mail one to me at blackstorm12@yahoo.com.
I could also understand from a forum post, but an example would be more helpful.
Thanks!
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
Yes, its quite simple to do. Simply give the people ball movement, and make an event which makes them look in the direction of the bullet. Of course, their speed needs to be more than 0
No, no, no...
The thing being sucked towards the bullet is going to be able to move as well. Otherwise, I wouldn't have needed help. This is going to be an online game, and the people can move around as they are being sucked towards the bullet.
What movement object are you talking about? Platform Movement object?
Edited by the Author.
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
Create a custom movement engine, then calculate the angle of the bullet object from the player using trig. Then, when you calculate the movement each loop, add in values for the direction of the bullet object as well as the intensity of the pull before you actually move the player sprite.
That sounds like it would work, though my lowly mind cannot comprehend all that data... In other words, I don't know trig yet.
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
Alright then, how do I make a magnet? They both work close enough to the same way...
Wise sayings:
"A pint of example is worth a gallon of advice."
"Do unto others as you want done unto you."
"An idea is nothing without effort."
"HOLY CRAP!"
X position of subject < X position of black hole
-X(subject)=X(subject)+1
X position of subject > X position of black hole
-X(subject)=X(subject)- 1
Y position of subject < Y position of black hole
-Y(subject)=Y(subject)+1
Y position of subject < Y position of black hole
-Y(subject)=Y(subject)+1
If you want the objects to be pulled towards the hole faster or slower depending how far away they are from it, have the events trigger a loop which moves the object. Trigger the loop (scaledmax - distance/scale) times, where scale is just an arbitrary divisor, and the scaled max is the maximum distance an object can be from the hole to be affected by it, pre-divided by the scale.