So... I'm working on a game where you're like this sort of James Bond, Mission Impossible, super spy-ish... dude. In the first level you have to use your epic spy glider to infiltrate the enemy base. Just one problem: the glider. I can't seem to come up with a reasonably good glider script. I just need something that will start at one corner of the screen and be flown to the bottom in a controlled way. The important bits:
1. The glider has to model lift, drag, and gravity. In other words, all the important things about flying.
2. The glider has to have some way of telling how hard you hit the 'ground', and saying that you died if you hit too hard.
3. I don't really care what the glider looks like, if it's not what I want, I'll make a new costume for it.
4. If anyone wanted to help with the rest of this game, I'd be much obliged.
Offline
Ermegerd. Bump.
Offline
Does this seem like what you want?
http://scratch.mit.edu/projects/fg123_tests/2745191
Offline
fg123 wrote:
Does this seem like what you want?
http://scratch.mit.edu/projects/fg123_tests/2745191
No, that's a rocket engine. I think he needs a glider engine like the one in Learn to Fly (the flash game, not the scratch project).
Offline
fg123 wrote:
I see, that shouldn't be too hard, if he is looking for something like that.
Do you think you could try that?
Offline
Molybdenum wrote:
fg123 wrote:
Does this seem like what you want?
http://scratch.mit.edu/projects/fg123_tests/2745191No, that's a rocket engine. I think he needs a glider engine like the one in Learn to Fly (the flash game, not the scratch project).
OK, so, I just played Learn To Fly, and basically, that's about it. Just... maybe a bit less pudgy and that actually FLIES to start with XD.
Offline
Scratcher456 wrote:
Molybdenum wrote:
fg123 wrote:
Does this seem like what you want?
http://scratch.mit.edu/projects/fg123_tests/2745191No, that's a rocket engine. I think he needs a glider engine like the one in Learn to Fly (the flash game, not the scratch project).
OK, so, I just played Learn To Fly, and basically, that's about it. Just... maybe a bit less pudgy and that actually FLIES to start with XD.
Technically, the gliders in LtF don't fly, they glide. The only way to actually fly in LtF is with rockets.
Offline
I saw this yesterday and started work on an engine. I'm not done with it (and I won't add scrolling), but it will meet all other requirements.
Square Quest: (You BETTER click here!!! XD)Offline
It doesn't need to scroll, if it turns out that I need more room to fly in, I'll just scale down the glider and the variables to make more out of less. I am pretty bad with physics in Scratch beyond simple gravity and stuff, so... Yah.
Offline
gamer2012 wrote:
I saw this yesterday and started work on an engine. I'm not done with it (and I won't add scrolling), but it will meet all other requirements.
It's fine without scrolling. I hadn't planned on having it in there, anyway. If it turns out I need more room, I can just scale down the glider and all the variables and make less look like more.
Offline
I'll get on it. It shouldn't take me too long; I've got an idea about how to do it.
The most important part of this entire engine is the part that takes the current angle and the current velocity and figures out the new velocity. It's actually not terribly hard. Here's how you do it:
- Project the current velocity vector onto the angle vector. You can then find the vector rejection by subtracting the projection from the old velocity.
- Multiply the projection by a friction variable, and multiply the rejection by an efficiency vector which represents how much air the glider catches. For gilder efficiency, 0 represents "perfect gliding," where just being horizontal prevents you from falling at all, 1 is no gliding, and basically makes the script the same as a normal velocity script. I would choose a value around 0.3.
- Add together the newly scaled projection and rejection variables to get the velocity.
- Change x and y by velocity.
And that's all! I'll upload an example to my test account some time soon.
Last edited by amcerbu (2012-08-25 14:16:58)
Offline
amcerbu wrote:
I'll get on it. It shouldn't take me too long; I've got an idea about how to do it.
The most important part of this entire engine is the part that takes the current angle and the current velocity and figures out the new velocity. It's actually not terribly hard. Here's how you do it:
- Project the current velocity vector onto the angle vector. You can then find the vector rejection by subtracting the projection from the old velocity.
- Multiply the projection by a friction variable, and multiply the rejection by an efficiency vector which represents how much air the glider catches. For gilder efficiency, 0 represents "perfect gliding," where just being horizontal prevents you from falling at all, 1 is no gliding, and basically makes the script the same as a normal velocity script. I would choose a value around 0.3.
- Add together the newly scaled projection and rejection variables to get the velocity.
- Change x and y by velocity.
And that's all! I'll upload an example to my test account some time soon.
See, this is why I ask for help on the forums... People like you actually understand this stuff, whereas it all goes completely over my head...
Offline
Here's the link (it's my test account):
http://scratch.mit.edu/projects/ubrecma/2746805
Offline
Thank you to everyone who posted on here! Amcerbu came up with just what I was looking for. However, if anyone else has a glider engine, I (and probably quite a few other people) would like to see them, so post away!
Offline
Should've posted this a WHILE ago: http://scratch.mit.edu/projects/gamer2012TEST/2746658
When you said glider, I assumed "hang glider". XD
Square Quest: (You BETTER click here!!! XD)Offline
Updated version with scrolling and horizontal currents: http://scratch.mit.edu/projects/gamer2012/2756613
Last edited by gamer2012 (2012-08-31 18:32:15)
Square Quest: (You BETTER click here!!! XD)Offline