Javascript Trigonometry approach to Game Programming

Completado Publicado May 13, 2015 Pagado a la entrega
Completado Pagado a la entrega

Two objects on the screen. 1 object's position around the screen is dictated by user's mouse cursor, as user moves its mouse cursor around, the object, called 2nd graphic, is changing positions on the computer screen.

The other graphic, inserted upfront onto the screen, can be called 1st graphic. Now. to make 1st graphic chase after 2nd graphic on the screen, no matter where the latter goes, the 1st graphic should detect its own position (x1, y1) in coordinates and compare it with the new (x2, y2) coordinates of 2nd graphic.

Take the vertical distance and horizontal distance between them, and calculate arctangent to determine the angle between them. This angle will allow 1st graphic to navigate in the right direct now towards the 2nd graphic. Sounds simple? The 2nd graphic is constantly moving around, so 1st graphic must constantly recalculate the new angle to get to 2nd graphic successfully.

Programmer must be willing to adhere to client's instructions to use arctangent approach to work out the angle between them before reaching for the 2nd graphic.

I have developed the source codes for making 1st graphic move in any direction based on the angle inputs entered by web audience, even any angle aroud 36 degrees. Can share the access to those codes with the right programmer

So the remaining challenge now for this project is only to compute the angle between 2 objects, so that the 1st graphic can navigate in the right direction towards 2nd graphic.

Prefer that the javascript programmer display the worked out angle on the computer screen, so we can see if it is correctly calculated.

Correction: Even any angle around "360 degrees", and not "36 degrees", for my typo error above.

User's mouse cursor will be able to move 2nd graphic's position around on screen at any time, and make 1st graphic thus chase after 2nd graphic in the new direction, by recomputing the above quickly, in a dynamic way.

Print out and display the "newest angle" on screen to do the chasing towards 2nd graphic from the 1st graphic, at any time. So, we can see and troubleshoot if your calculations is correct or wrong.

JavaScript Matemáticas MySQL PHP

Nº del proyecto: #7667406

Sobre el proyecto

1 propuesta Proyecto remoto Activo May 14, 2015

Adjudicado a:

Codware

I'm not really sure what do you need here. You just need to compute an angle between 2 points? Please call me in the chat so we can talk more about it.

$150 USD en 2 días
(41 comentarios)
6.0