Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-12 Thread Kevin Fishburne
On 10/11/2013 08:20 AM, Jussi Lahtinen wrote: > My brains jammed to think about that wrap function, and I think if you want > function that wraps screen like in old video > games, then is that C implementation really correct? > > They say that Wrap(-1, 1, 4) should return 3, but if you have travele

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-11 Thread Jussi Lahtinen
My brains jammed to think about that wrap function, and I think if you want function that wraps screen like in old video games, then is that C implementation really correct? They say that Wrap(-1, 1, 4) should return 3, but if you have traveled two steps over border of the screen (1 -> 0, 0 -> -1)

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-10 Thread Kevin Fishburne
On 10/10/2013 06:02 PM, Benoît Minisini wrote: > Le 10/10/2013 23:50, Kevin Fishburne a écrit : >> On 10/10/2013 05:07 AM, Fabien Bodard wrote: >>> Maybe some parts of your rendering engine must in final be in a lib like >>> gb.sge >> Is there a reference doc for that component? I don't see it in t

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-10 Thread Benoît Minisini
Le 10/10/2013 23:50, Kevin Fishburne a écrit : > On 10/10/2013 05:07 AM, Fabien Bodard wrote: >> Maybe some parts of your rendering engine must in final be in a lib like >> gb.sge > > Is there a reference doc for that component? I don't see it in the wiki, > but seem to remember someone mentioning

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-10 Thread Fabien Bodard
Maybe some parts of your rendering engine must in final be in a lib like gb.sge Le 9 oct. 2013 22:15, "Kevin Fishburne" a écrit : > On 10/09/2013 01:46 PM, Jussi Lahtinen wrote: > > Are you using SDL, OpenGL? > > > > What is the map size? > > > > How many lines of code? > > Run this on your proje

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-09 Thread Kevin Fishburne
On 10/09/2013 01:46 PM, Jussi Lahtinen wrote: > Are you using SDL, OpenGL? > > What is the map size? > > How many lines of code? > Run this on your project folder to know: > find . -name '*.class' -o -name '*.module' | xargs wc -l > > I have also written some game (RPG), but it seems I really don't

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-09 Thread Jussi Lahtinen
Are you using SDL, OpenGL? What is the map size? How many lines of code? Run this on your project folder to know: find . -name '*.class' -o -name '*.module' | xargs wc -l I have also written some game (RPG), but it seems I really don't have time for it. Maybe some day. Also I have big problems t

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-08 Thread Kevin Fishburne
On 10/08/2013 09:14 AM, Jussi Lahtinen wrote: > http://stackoverflow.com/questions/707370/clean-efficient-algorithm-for-wrapping-integers-in-c >> It's also possible that I mistranslated the C code in the above link, as >> I don't know C. >> > Yes, because Gambas makes automatic conversions and thus

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-08 Thread Jussi Lahtinen
http://stackoverflow.com/questions/707370/clean-efficient-algorithm-for-wrapping-integers-in-c > > It's also possible that I mistranslated the C code in the above link, as > I don't know C. > Yes, because Gambas makes automatic conversions and thus the line where division is, gives sometimes diffe

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-07 Thread Kevin Fishburne
On 10/06/2013 07:08 AM, Jesus wrote: > Hi, Kevin > > Well, as you know, screen coordinates start in the upper left corner and > grow towards the right in the X axis and towards the bottom in the Y > axis. Sorry if it's too obvious. > > So all operations on an hypothetical spaceship, must be done on

Re: [Gambas-user] "wrapping" function based on recent Mod thread

2013-10-06 Thread Jesus
El 06/10/13 05:40, Kevin Fishburne escribió: > Jesus Guardon said in the recent thread "Modulo operator returns wrong > results ": > > Hi Paul et all > > When working with some video games, there are a feature called > wraparound or screen wrap. It consists on objects leaving one sid

[Gambas-user] "wrapping" function based on recent Mod thread

2013-10-05 Thread Kevin Fishburne
Jesus Guardon said in the recent thread "Modulo operator returns wrong results ": Hi Paul et all When working with some video games, there are a feature called wraparound or screen wrap. It consists on objects leaving one side of the screen that immediately reappear on the opposi