www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/03/14/01:47:25

From: cwebb AT nospam DOT ctos DOT com (Christopher Webb)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Allegro and Asteroids
Date: Fri, 13 Mar 1998 20:08:34 GMT
Organization: SuperNet Inc. +1.303.285.0194 Denver Colorado
Lines: 19
Message-ID: <350991b8.19264187@news-2.csn.net>
References: <34F9F4B1 DOT 6CE0 AT home DOT com>
NNTP-Posting-Host: 138.86.7.43
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Sun, 01 Mar 1998 15:52:17 -0800, Dan <dyoon AT home DOT com> wrote:

>         float radian_angle = (angle*180)/PI;

>the ship starts off with the front of the ship pointing north, so the
>ship's "angle" variable starts off at 90.  

>so if i just press the up arrow key from the
>start of the game, the ship should go up the screen?  instead it goes at
>some weird angle.
>

Your conversion looks backwards: if angle is degrees, then you need to
multiply by (radians/degrees) to convert it to radians.  Try

float radian_angle = angle * (PI/180);

Christopher Webb
cwebb at ctos.com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019