PLz help me (again)

Posted by n1ko on Aug. 2, 2006, 11:42 a.m.

okay, im going to post yet antoher blog askin for help with a game. here it goes : im making a simple tanks game(not top down), with destructable terrain and such, where the tanks shoot the bullets like morters.yeah. anyway, i need help, cause im making an ai tank that is supposed to aim at the player an shoot. but i have tried a few tings, and none have worked. basically, the ai tank's turret faces direction using facing_direction var and the bullet is created moving in that direction, with its speed set to turret's power var.(the power var and facing_direction var need to change values to adjust the shot so that the tank can score a hit on the player.) yeah, i jus sorta rambled a lot, but if you could understand wat i ment, then plaz help me out!

Comments

aeron 18 years, 4 months ago

sounds like schorched earth… well to do this you'd need to understand some advanced trigonometry and create an algorithm to calculate the angles and power, so unless you want to do tons of work, I'd make it guess, and if the shot is in between its target it adjusts a bit to make it go slightly further. if its too far it adjusts to go less.

n1ko 18 years, 4 months ago

wow 64d, thanks for the waves of responses…