JPickard, if you solve this mystery, I will so put you in the credits of my game! You'll be my hero. Tomorrow, I will be following this thread while studying for my exam. :P
Yes, I am on the forums a lot less lately. I found your thread via JPickard's comment on my "issues with 0.9.5" post. Anyhow, the solution you seek is thus:
Two parts:
Part 1: You want the actor himself to be able to launch himself. That's easy enough, instead of spawning a blue ball, just spawn an actor that looks like the stationary actor, when it comes to a full stop then switch back to the "laucher" version of the actor. In this way you have two actors, that to the player, look like one actor. One version is the stationary "launcher" version and the other is the in-flight flying actor.
To detect a full stop constrain speed = magnitude(linearVelX, linearVelY) rule when speed < 100 .... spawn launcher, destroy self
The second part of your question: How do you set up the trajectory arc from anywhere on the field instead of the bottom left corner is a bit more complex. That demo I made takes some assumptions, the most important of which is that the launcher is in the bottom left corner. At this point it's to complicated to explain how to set up the trajectory arc from a different location and I encourage you to talk to your math teacher about it. It should be a fun exercise for the both of you. It is very possible to do (I've done it before, but the code isn't mine and I can't post it) You should have fun learning how the math works and you'll be able to be more creative in your designs once you understand what the code is doing.
I rigged up the trajectory arc demo after reading this:
Hey ORBZ. Thanks for coming to this thread and visiting my problem. So thanks for the full stop thing that was very helpful and yes, I will probably end up asking my math teacher. This is a 1 part problem though, because I only want the trajectory arc to come from the actor that is moving across the field. So I guess I would change the fire blue ball to moving the gun itself, and then that is where the trajectory field comes from… the exact same actor, just on a different coordinate. Is there anyway to get the arc to start specifically from the character using it as a variable of some sort? Also, brain fart here, I know I've done it before, but how do I get the character to move along the path?
If I understand you correctly, you want to see like how the dots are spawning and stuff?? I am basing my game off this template so just search trajectory in the GameSalad Creator, double click it and press preview. You can see how the dots spawn and move accordingly with the mouse. Now go back into the editor, and move the gun (rectangle) somewhere in the middle of the screen, doesn't really matter where, just away from the (0,0) corner. Now press Preview. You should see my issue right away!
Well. I fiddled a bit with the demo. Moving the Cannon like you said, so now I know exactly what you need. And then Game Salad crashed. Naturally.
Beyond the math, I'm wondering if the math is already done, can you just constrain the cannon to the last trajectory ball, or something? I'll mess around with it a bit more in the morning.
I made it stick to the center of the actor on the X axis, but then it was all demented while moving up and down. And obviously, so close to a breakthrough, GameSalad crashed on me.
I'm trying to be too clever for my own good. I'm trying to just replace the projectile actor with the gun actor (or a duplicate of it) and then destroy the original gun actor. It might work. As a work around.
Comments
I'll put aside some time saturday afternoon to try to fathom it.
Yes, I am on the forums a lot less lately. I found your thread via JPickard's comment on my "issues with 0.9.5" post. Anyhow, the solution you seek is thus:
Two parts:
Part 1: You want the actor himself to be able to launch himself. That's easy enough, instead of spawning a blue ball, just spawn an actor that looks like the stationary actor, when it comes to a full stop then switch back to the "laucher" version of the actor. In this way you have two actors, that to the player, look like one actor. One version is the stationary "launcher" version and the other is the in-flight flying actor.
To detect a full stop constrain speed = magnitude(linearVelX, linearVelY)
rule when speed < 100 .... spawn launcher, destroy self
The second part of your question: How do you set up the trajectory arc from anywhere on the field instead of the bottom left corner is a bit more complex. That demo I made takes some assumptions, the most important of which is that the launcher is in the bottom left corner. At this point it's to complicated to explain how to set up the trajectory arc from a different location and I encourage you to talk to your math teacher about it. It should be a fun exercise for the both of you. It is very possible to do (I've done it before, but the code isn't mine and I can't post it) You should have fun learning how the math works and you'll be able to be more creative in your designs once you understand what the code is doing.
I rigged up the trajectory arc demo after reading this:
http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
Beyond the math, I'm wondering if the math is already done, can you just constrain the cannon to the last trajectory ball, or something? I'll mess around with it a bit more in the morning.
How's your messing around coming along?
edit: It beats doing math.
But actually, I still have to put in a few actual actor images instead of just color squares to test it.
the forum isnt a personal messageboard