this is quite embarassing, i've never used a 360 degree movement.
And none of the many examples/articles i've followed, has worked
Maybe it's me, or my machine, or my MMF 1.5, but i can't get anything 360 degree related to work . I'd need a 360 degree racing movement (not too complicated, just the standard stuff, i can do sliding and stuff myself when i've learned the basics) and 360 degree shooting.
PLEASE HELP!
n/a
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
19th April, 2005 at 21:14:39 -
360 is quite simple, even if you don't understand the maths involved. Create a counter or some sort of value (alterable, global, etc.). This counter is the object's angle.
Repeat while right is pressed: Add 2 to counter
Repeat while left is pressed: Subtract 2 from counter
Repeat while forward is pressed: Set active1.x to (active1.x * cos(counter) * [speed])
: Set active1.y to (active1.y * sin(counter) * [speed])
Where it says [speed] insert a value. I recomend 10,50, or 100 depending on the speed of your car.
and there you go, it may not completely suit your game's personal needs, but it's more or less complete, and if you know your math well, you can actually understand what's going on in the equations, and make up the rest of the 360 degree possibilities of MMF, and even make your own 360 degree shooting engine without asking
but ... people will be here to help if you do get stuck, so what i'm saying is, try things out first, and if you can't get it right, take up some tuts, and then finally ask for help
You need to include the image for the Active Picture Object. But maybe using the ALpha Channel object might be a better idea because the picture can be internal and have multiple animations.
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
20th April, 2005 at 19:20:46 -
Woopsie, my bad. The reason it is dissapearing is because it is moving so fast. I accidently wrote multiply, instead of plus.
Repeat while forward is pressed: Set active1.x to (active1.x + cos(counter) * 10)
: Set active1.y to (active1.y + sin(counter) * 10)
That will work. However you may find that the object moves in the wrong direction, this is because the active picture may use a differant starting angle. For example, 0 degrees may be right. Or 0 degrees may be straight up. To fix that problem just add 90 degrees or something to the counter.
Set active1.x to (active1.x + cos(counter + 90) * 10)