Week 4.A Devlog: Trouble with missiles. | Escape From the M'lon Factory


Welcome to Devlog 4.A

Why 4.A? Well, I have been working on a obstacles called Missiles, so far I cannot do missiles. I am working to get this done, so I hope to get it done soon, but for now I'll talk about what I got up to in this 4.A (week 5 will still happen.)

What I did this Week:

I made some spinning variants of the normal obstacle, these were pretty easy to implement, just rotate them by a set amount every turn.

Now, the meat. This might get a bit rambly, so be warned!
Missiles. Missiles. The idea for this obstacle was for a missile to track the player's location on vertically and then launch a missile. It didn't work, although I made a neat asset for the alert function. 




After this I approached it from a math stand point, and got some help from a friend, attempting to design a function to help predict the missile and give it some over swing. This didn't work.

   dy = (Player.transform.position.y - transform.position.y);
   dv = PlayerPhysics.velocityY - MissilePhysics.velocityY;
   force = a * dy / (dv*dv) + b * dv / (dy*dy);

I also attempted a basic ish transform approach, but this didn't work because the missile seems unable to get the updated position of the player. I will workshop this as I think this is the issue. 

 if (transform.position.y >= 4)
   {
       transform.position = new Vector3(transform.position.x, 4);
   }
   if (transform.position.y <= -4)
   {
       transform.position = new Vector3(transform.position.x, -4);
   }


This is all I've got for now, I'll be adding a Week 4.B soon,I hope. If it doesn't pan out I will probably have to cut missiles, Update soon!

Leave a comment

Log in with itch.io to leave a comment.