What I think I should do for a Bow is: "Upon pressing (a button)" Make active 1 Shoot Arrow in direction of Active 1. The Arrow itself will have Gravity added to it, using either Vector movement, or Platform movement. Any other suggestions?
when you shoot the arrow, give it both X & Y velocities as variables. Use an "Always: Position = Position + Velocity" event for both X & Y. Then, always add 1 or whatever to the Y velocity, which simulates gravity downwards.
I left the source code open so you guys could take it apart and look at how it works. I learned most of what I did by taking apart other people's code.
Disclaimer: Any sarcasm in my posts will not be mentioned as that would ruin the purpose. It is assumed that the reader is intelligent enough to tell the difference between what is sarcasm and what is not.
Sure enough, but I don't have the full version of MMF2 I was going to get some help on paying for a PS2 for christmas (PS3s are WAY out of my budget! ), and the full version of TGF2. And then I realize that MMF2 is more advanced (and more costly)than TGF2. So instead of the PS2 THAT I'VE BEEN TRYING TO SAVE UP FOR... May just have to wait. I think I'd rather have MMF2. As for the PS2, I wanted Kingdom Hearts, Kingdom Hearts II, Guitar Hero, Rock Band (DRUMSET?! ALRIGHT! ),and Sonic Riders: Zero gravity.
make sure you don't get MMF2 developer, just MMF2 standard. Many people have made that mistake; the only *real* difference is that MMF2 developer has a few less legal obligations for selling commercial products, which won't matter to you. And thats a big "not" difference for $200
as far as the velocity stuff; its very easy to make the X = X + V stuff work, its not complicated at all. However, finding out how to AIM the arrow, thats complicated. Very complicated. Theres some funky physics formulas that can reverse newtonian velocities, and you need to do trigonometry to convert a *DIRECTION* to *X/Y VELOCITIES* so yes it can be a little work
Yeah. MMF2 developer is WAAAAAAY out of my budget . I'll get either of the two (preferably MMF2... ).
And about the bow and arrow, it won't be controlled by mouse movement. It'll just be in two directions, as a basic attack used by an active object on Platform movement.
if you have X & Y velocities, and a constant Y acceleration for gravity, then to get from sitting still at point (X1,Y1) to some point (X2,Y2) at a constant projectile speed S, than first you set some variable D to Sqr((X2^2 - X1^2) + (Y2^2 - Y1^2)), for distance, than you set the X velocity to ((X2 - X1) / (D / S)), thats the easy part, than you find the Y parabola so the intercepts are X1 & X2, which are 0 & (X2-X1) relative to the initial point, so using Y = 0 = Y_velocity * T - Gravity * T^2, where T = (D/S), the point where X position is now at X2, we solve for Y = 0, which would be Y_velocity = (Gravity / (D/S)), thus we have:
Given (X1,Y1) & (X2,Y2)
D = Sqr((X2^2 - X1^2) + (Y2^2 - Y1^2))
S = Projectile speed in Pixels/Seconds, for overall movement
gives:
X velocity = ((X2 - X1) / (D / S))
Y velocity = (Gravity / (D/S))
mostly copy/pasted that from earlier work, hope its still right. Complicated, eh?
damn I made a few mistakes back then. That will only work from same Y level to same Y level, and I forgot to double gravity when I integrated. I'm gonna churn out a new one,sec
Given (X1,Y1) & (X2,Y2)
D = Sqr((X2^2 - X1^2) + (Y2^2 - Y1^2))
S = Projectile speed in Pixels/Frame, for overall movement
gives:
X velocity = ((X2 - X1) / (D / S))
Y_velocity = (Y2-Y1)/(D/S) - (Gravity *(D/S))/2
Ok thats the one that works
That can make enemies shoot projectiles that will ALWAYS arc towards the player, instead of shooting straight at him, or whatever. Very useful for making nifty little tanks in those flying-spaceship games that run along the ground and lob cannon balls up at you, or stuff like that.
you know what? how about just trying this out:
http://claniraq.googlepages.com/Projectile.gam
Made it in TGF, so you can run it even if you don't have MMF2, you just need the AMATH object
Sorry I was gone awhile, Can't remember what I was doing warlier but Oh well. Yeah, that stuff could work, but if this changes the topic (Guess I should've said this earlier. CRAP. ) it'll be the feature for a UI controlled active, on Platform movement of course. I'm not so hot at the expression editor. I'm not really a pro, but I'm not a beginner either. I'm kind of in between those two .
Originally Posted by Drawcula Yeah. MMF2 developer is WAAAAAAY out of my budget . I'll get either of the two (preferably MMF2... ).
And about the bow and arrow, it won't be controlled by mouse movement. It'll just be in two directions, as a basic attack used by an active object on Platform movement.
Anyways, thanks for the help!
When I said either of the two, I meant TGF2 or MMF2. In case you were wondering.
An old and washed up once-kid
Assault Andy Administrator
I make other people create vaporware
Registered 29/07/2002
Points 5686
12th November, 2008 at 03:53:57 -
I have developer but I want to sell commercial applications and games