Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scea.yaroze.programming.2d_graphics Subject: Re: in need of assistance... Date: Wed, 23 Jul 1997 09:57:52 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 57 Message-ID: <33D5C790.4BE@interactive.sony.com> References: <01bc970d$ea6221c0$12c562cf@mattguyo> NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) Matt Guyot wrote: > > ok... im an ultra-newbie at this stuff so please bear with me.... > > here is the source for the program i am working on... it is just a modified > version of one of ira raineys demos... all i have done is change the > outcomes of pressing the buttons... the d-pad rotates and the square > accelerates... > > i have three concerns as of right now... > > 1) i have coded a couple of lines in there in an attempt to set a maximum > velocity in both the x and y directions... this does not work... > The reason for this is that the two velocity components, velx and vely, can become enormously negative; your code only prevents them becoming enormously positive. Use of on-screen debug messages (use FntPrint, initialised with FntLoad and FntOpen, as in lots of sample code) would have shown this. > 2) it appears that while the sprite can face any direction (something like > 80, 90 or 120 headings) it can only have a velocity along eight of these > (N, NW, W, SW, S, SE, E, NE) i wrote the little trig thing in there to > avoid just that... i dont know why it is only giving these eight > directions... > Not convinced of this, it looks to be moving all over the shop to me. > 3) i have no idea why it slows down when you accelerate and turn at the > same time.. this doesnt seem likely to be stressing the limits of what the > machine can do (even with my naturally un-streamlined code)... but there is > an obvious slowdown... The slowdown is purely due to what happens when you change speed; you are calculating the new speed components using the function. This is incredibly slow. In much of the sample code, you will see lookup-table sin,cos and tan modules with nice interfaces, enabling the use of trigonometry at high speed. The library sin,cos,tan etc are very accurate but far too slow to use. Lewis > > if one of the gurus of 2d gaming could offer some aid, i would greatly > appreciate it.... > > thx > matt > > Name: main.c > Part 1.2 Type: unspecified type (application/octet-stream) > Encoding: x-uuencode > > Name: Try3.tim > Part 1.4 Type: unspecified type (application/octet-stream) > Encoding: x-uuencode