Recent Posts

Pages: [1] 2 3 ... 10
1
I will just add a little to above response from Qedo.
In GlBasic there are 3 types of variables: # - floating point (default), % - integer, $ - string. You should always use those chars in declaration of vars and also functions, so in this code use KONV$ instead of KONV (that would return floating point value).
Second issue: GLB converts code to C++ sources, that are later compiled by GCC, in C++ (and other languages) the '\' is an escape character for special commands like regex expressions, and compiler tries to handle '\\' as such special command. It only aplies to statically typed string's so it wont appear in string from Input, grabbed from files, made with Chr$() and so on.
To avoid this just use:
GLOBAL a$="Test" + CHR$(92) + CHR$(92) + "//Test"
2
Change KONV in KONV$ (2 places).
The second \ disappears because \ is a special character and works in tandem with the next
3
Hallo,
Eine Funktion zum ersetzen der "\" mit "/" (zum Dateinamenumwandeln für SHELLCMD) gibt keinen Wert zurück wenn der String Sonderzeichen wie "\" oder "/" enthält. Es wird auch nur ein "\" in der Funktion umgewandelt, das 2. verschwindet ....

Code: GLBasic [Select]
GLOBAL a$="Test\\//Test"
PRINT a$,10,30
PRINT KONV(a$),10,100
SHOWSCREEN
MOUSEWAIT

END


// ------------------------------------------------------------- //
// ---  KONV  ---
// ------------------------------------------------------------- //
FUNCTION KONV: wert1$
        // Diese Variablen sind als LOCAL definiert:
        // wert1$
LOCAL wert2$

FOR t=0 TO LEN(wert1$)-1
        IF MID$(wert1$,t,1)="/"
                wert2$=wert2$+CHR$(92)
        ELSE
                wert2$=wert2$+MID$(wert1$,t,1)
        ENDIF
NEXT
PRINT wert2$,10,50
RETURN wert2$
ENDFUNCTION // KONV

 
4
2D-snippets / Re: Fill Fast Line algorithm
« Last post by Qedo on Yesterday at 03:57 pm »
dreamerman, I searched the internet for the best filling algorithm and implemented it in GLB. I do not think there are others, but I can be wrong.
At the beginning I was very doubtful about the efficiency of DIMPUSH / DELETE and the FOREACH / NEXT cycle but I have to say that I'm not a real bottleneck. To get rid of all doubts it would be interesting to implement it in c ++ but for the moment I am satisfied with this version.
5
GLBasic - en / Re: Future of Glbasic or the ending?
« Last post by spacefractal on 2018-Aug-15 »
Today all my apps is now gone from App Store as well. So now im are back to only using Windows my self. So im cannot support Android and iOS anymore. Howover im do still have two apps on Ouya, which was a great little test console, even im never got some money from it. its was still fun.

Some of my games could do come to Amazon Fire exklusive on their tables throught.
6
2D-snippets / Re: Fill Fast Line algorithm
« Last post by dreamerman on 2018-Aug-13 »
Nice, good to have such code ready for use in future. Did you tried other filling algorithms, even just to compare speed? Don't know what impact have those DIMPUSH / DELETE commands.
7
2D-snippets / Re: Fill Fast Line algorithm
« Last post by bigsofty on 2018-Aug-10 »
Cool, thanks Qedo!  :good:
8
2D-snippets / Fill Fast Line algorithm
« Last post by Qedo on 2018-Aug-10 »
After i have grabbing with both hands in the forum a small summer gift (I hope it will be appreciated).
You find the scanline floodfill algorithm using stack instead of recursion.
I converted the version I found in internet from C++ to GlBasic.
Compared to the standard version this is much faster about 10-15 times.
When you start the program for the first 10 seconds, the standard (more slow) version is executed and  after the scanline version.
The program uses my FASTMEM2SPRITE version (which you already sent a while ago and which I have now improved), but you can comment the command and activate the standard MEM2SPRITE to appreciate even more the change of speed.
Let me know
9
Announcements / Re: PMS
« Last post by bigsofty on 2018-Aug-08 »
Thanks for the tips Jay, that’s an interesting take on camera movement(the scoring mechanism is something I’ve not seen before either). I’ll give it a go as I’m intrigued to see how this animates the display. I’ll probably add some sort of distance calculation to only move the camera when it’s a certain distance from the player as well. This should contribute to smoothing things out too.
10
Announcements / Re: PMS
« Last post by Jayenkai on 2018-Aug-07 »
a=a-((a-b)/c)

Might be helpful to smooth things out a bit.
eg,
CameraX=CameraX-((CameraX-CameraXTarget)/8)   (tweak divider to make faster/slower)
CameraY=CameraY-((CameraY-CameraYTarget)/8)

Also
ScoreDisplay=ScoreDisplay-((ScoreDisplay-TrueScore)/4) ; if Abs(ScoreDisplay-TrueScore)<4 then ScoreDisplay=TrueScore; Print ScoreDisplay
gives more of a "ticking" score display.

You can probably find a bucketload of other uses for the incredibly simple bit of maths.
Pages: [1] 2 3 ... 10