Retrogamecoding(.org) > General game development

Rotate and fire

<< < (2/4) > >>

johnno56:
This looks interesting! But I have to get some sleep first... Will attempt a test some time later this morning... Many thanks for the code snippet.

J

ZXDunny:
In general you want to avoid performing trig during loops, so pre-calculate your dx/dy for the projectile when the user presses fire and use those to update its position for its lifespan.

johnno56:
I agree with 'pre calculate', instead of 'on the fly', as a good practice to adopt. But, my question would be, why? "Back in the day" (and they never say which day... lol) I can understand the reasons. Slower processors to laboriously use trig calculations would tend to 'slow things down'. But what about today? Processor speeds have increased by leaps and bounds and memory storage has gone through the roof. I can see where pre-calc would be beneficial when it comes to a game that is heavy in number crunching (3D'ish type games) but for a game that is, by all intent and measure, a 'retro-style' game? I would be curious as to whether or not there would be a "savings" on machine load... Just a thought... I think of stuff like that from time to time... lol

J

ScriptBasic:
Have you tried NaaLaa? It is the perfect language for what your after. The author is a commercial game developer in real life.

johnno56:
I most certainly have... Great bunch of guys there... Very helpful... I even have the Linux version installed. Now that you mention it, I must pay them a visit... But, living on the other side of the planet, makes discussions stretch out... lol  Thanks for the suggestion. Much appreciated.

J

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version