Passive Homing Missile
7 posts • Page 1 of 1
Passive Homing Missile
Hi guys, if I already post a topic about this, make me know.
Well, I only wanna see what do you think about my missile, and see your suggestions too, because I stopped working on it for a few months and I don't know what to improve to it.
I'll accept any idea.
Well, I only wanna see what do you think about my missile, and see your suggestions too, because I stopped working on it for a few months and I don't know what to improve to it.
I'll accept any idea.
- Luezma
- Posts: 14
- Joined: Thu Dec 13, 2012 7:19 pm
- Location: Argentina
Re: Passive Homing Missile
Just out of curiosity, how are you making the camera follow the little circle?
-
Sonic - Posts: 1467
- Joined: Tue Sep 01, 2009 6:18 pm
- Location: America!!!
Re: Passive Homing Missile
my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
- jon_joy_1999
- Posts: 233
- Joined: Fri Dec 09, 2011 12:51 am
Re: Passive Homing Missile
jon_joy_1999 wrote:my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
Well, the velocity limiter is just for fun, I can delete it. The camera PAN changing is just some stuff, nothing nessesary
- Luezma
- Posts: 14
- Joined: Thu Dec 13, 2012 7:19 pm
- Location: Argentina
Re: Passive Homing Missile
jon_joy_1999 wrote:my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
That's a very strange script! Could you please explain how it works and what it does? And why the strange math, such as entity.vel / 1.075 and entity.vel / 6.5? Also, why do you check to see if _Vel is > +inf? !!! How can any variable be greater than infinity? Also where does _Vel get defined?
Thanks
EDIT: I just realized that _Vel was defined in luezma's scene. But I still don't understand the rest of the script.
-
Xray - Posts: 500
- Joined: Sun Jun 17, 2012 6:12 am
- Location: USA
Re: Passive Homing Missile
Xray wrote:jon_joy_1999 wrote:my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
That's a very strange script! Could you please explain how it works and what it does? And why the strange math, such as entity.vel / 1.075 and entity.vel / 6.5? Also, why do you check to see if _Vel is > +inf? !!! How can any variable be greater than infinity? Also where does _Vel get defined?
Thanks
EDIT: I just realized that _Vel was defined in luezma's scene. But I still don't understand the rest of the script.
First: "+inf" is an constant variable, here it means the maximum speed that the ship can get, if you change "+inf" to "2", if will start dividing the ship's speed by 1.075 until it reaches 2m/s, that makes deceleration and works to limit speed.
Second: "_Vel" is the magnitude of the "entity.vel" vector, it is to see the current speed of the entity.
Third:
- Code: Select all
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
This script works to move the camera (with some damping) where is the current position plus the speed divided by 6.5. If you change the "4" in the last division, you will change the camera damping, when bigger, more damping
- Luezma
- Posts: 14
- Joined: Thu Dec 13, 2012 7:19 pm
- Location: Argentina
Re: Passive Homing Missile
Xray wrote:jon_joy_1999 wrote:my response does not imply that I suggest the use of this function, nor that I will not hunt you down and stab you in the eyes with a spoon repeatedly if you do use this function
- Code: Select all
_Vel > +inf ? {entity.vel = entity.vel / 1.0750000} : {};
Scene.camera.Pan = Scene.camera.Pan - ((Scene.camera.Pan - (entity.pos + (entity.vel / 6.5000000))) / 4);
That's a very strange script! Could you please explain how it works and what it does? And why the strange math, such as entity.vel / 1.075 and entity.vel / 6.5? Also, why do you check to see if _Vel is > +inf? !!! How can any variable be greater than infinity? Also where does _Vel get defined?
Thanks
EDIT: I just realized that _Vel was defined in luezma's scene. But I still don't understand the rest of the script.
1. +inf is the speed that must reach to divide the speed, is +inf by now because it doesn't have limits
2. I'm dividing a vector, is the same thing that this:
- Code: Select all
vector * (1 / value)
- Luezma
- Posts: 14
- Joined: Thu Dec 13, 2012 7:19 pm
- Location: Argentina
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest