From: Ebola Newsgroups: comp.games.development.programming.algorithms,comp.os.msdos.djgpp Subject: Calculating direction to shoot in Date: Sat, 01 May 1999 15:15:24 +0200 Organization: The South African Internet Exchange Lines: 9 Message-ID: <372AFE6B.D048BBCE@webmail.co.za> NNTP-Posting-Host: gw53-01-p66.ec.saix.net Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: news3.saix.net 925564651 15879 196.25.137.66 (1 May 1999 13:17:31 GMT) X-Complaints-To: abuse AT saix DOT net NNTP-Posting-Date: 1 May 1999 13:17:31 GMT X-Mailer: Mozilla 4.5 [en] (Win98; I) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com I am programming a 2d space game. The game is seen from aboce and the player can rotate his ship so that he can travel in any direction, not just up, down, left and right. The problem is: How do I calculate the direction/angle the computer controlled enemies have to shoot in to hit the player? For example: The player is at coordinates (101, 254) and the enemy is at (235, 456). How can I calculate the angle between them?