Path: chuka.playstation.co.uk!scea!peter_alau@playstation.sony.com From: Omar Metwally Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: SV: lasers?! :-( Date: Mon, 21 Dec 1998 11:30:21 -0800 Organization: SCEA News Server Lines: 40 Message-ID: <367EA1CD.AF7A9AEB@aol.com> References: <3661BAFE.FF254984@aol.com> <73ul36$mu11@chuka.playstation.co.uk> NNTP-Posting-Host: 205-220-54.ipt.aol.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.07 [en] (Win95; I) Anders Clerwall wrote: > You have a position of the laser at t=0, and you know which way your ship's > facing. > All you have to do is to calculate a k vector with the speed of the beam and > add that > to the laserbeams position every frame. At least that's how I would do it :) > > vector k, ship_pos(0, 0, 0), beam_pos(0, 1, 1), ship_angle(60, 0, 10); // > for example > vector beam_speed(0, 0, speed); // for example > k=beam_speed.rotate(ship_angle.x, ship_angle.y, ship_angle.z); > then for every frame do: > beam_pos+=k; > that should do it, now I haven't tested this since I don't have the > compiler.. I really need the compiler guys!!!.. haven't gotten any response > from sony. Could anyone mail me the compiler?? please.. ah well, I don't > know. > > >i need a simple laser-firing function. i tried to use Nick F's Amateur > >Wars, but that was really complicated (i'd have to change my WHOLE > >control scheme). if someone could write out a simple function which > >make a laser fire in the direction it was fired, that would be great. > >if not, please direct me to somone's code which could help me do that. > >thanks. > > > >:-) > > > >Metwally7@aol.com > > > >by the way, i'm using George Bain's code (ch.4--lesson 4) tutorial > >(thanks George, it was a BIG help) > > Are we still talking plain 2-D shooter :-) I think that is a little to complicated--if you want to get into vectors. If you've played Nick F's Amateur Wars, you'll know what I'm talking about.