Winz00e (ver 6.0)
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Zone of the Mecha: How does it work?

2 posters

Go down

Zone of the Mecha: How does it work? Empty Zone of the Mecha: How does it work?

Post by InfinitasImpetum Sun Jul 27, 2014 11:31 pm

well, making this thread to help other who are curious on how my code works. will not be posting any code though but explaining how it works.

The Camera
first thing the Camera,to achieve a camera that behaves the way it does and look at both the player and the target i had to first set the position of the camera to be the center point or offset point you can say of the player.  then in order for it to follow the target i have the camera look at the target. after its rotated to point/look at the target i back the camera up so its then behind the player. this then achieves the desire effect i require for the camera.   if the player isn't locked on to anything, i have the camera copy the player rotation data so it looks like its following the player.

The Movement
how does the movement work? well first i get a speed value telling how fast it goes. using that value i determine that when you go towards or away from the enemy you move at that exact speed. how do i handle rotation around the target? i first get the radius of the circle that is created from the distance between the player an the the target then i use that to calculate the circumference aka distance around a circle. using speed i divide the speed by the circumference and then multiple it by 360. by doing this i get the angular speed of the player when going around the target. setting rotation is done by making the player look opposite from the previous position it was at.
InfinitasImpetum
InfinitasImpetum
(0%)-Lv8
(0%)-Lv8

Posts : 2162
Join date : 2012-05-30
Age : 34

Back to top Go down

Zone of the Mecha: How does it work? Empty Re: Zone of the Mecha: How does it work?

Post by InfinitasImpetum Mon Aug 04, 2014 8:45 pm

added movement explaination.
InfinitasImpetum
InfinitasImpetum
(0%)-Lv8
(0%)-Lv8

Posts : 2162
Join date : 2012-05-30
Age : 34

Back to top Go down

Zone of the Mecha: How does it work? Empty Re: Zone of the Mecha: How does it work?

Post by mangak (GONE) Tue Aug 05, 2014 6:25 am

keep it up
mangak (GONE)
mangak (GONE)
(100%)-Lv8
(100%)-Lv8

Posts : 3910
Join date : 2010-10-09
Currently : Freagin Heaven!!

http://www.winz00e.com

Back to top Go down

Zone of the Mecha: How does it work? Empty Re: Zone of the Mecha: How does it work?

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum