123 basic - HTML5 for GLBasic

Previous topic - Next topic

erico

Strange, I still get "Image not available ´1´".
Even if I intend the loading routines.

mentalthink

HI Erico I speaking into Computer in Local with the Compiler of Coolo all I put this night is about PC Compiler...
If you are in the online editor, take in mind you have to Upload the files in Assets, I think you have to avoid Setcurrentdir, but runs fine, for me runs without problems...

I make a "bit serious test" so , near A coleague and me launch a Zombie Game, very simple, but we want a Html5 tool, and the test I do, the Coolo's Html runs very very faster, it's awesome, I'm only thinking in 3D , three.js can be the best choice, the problem it's different to the 3d of GLbasic, but extremelly more powerfull.

MrTAToad

Quote from: coolo on 2013-Nov-21
MrTAToad: Strange, Everything works OK here, have you tried refreshing?
Indeed - I'll try it on a different browser soon.

Qedo

Coolo,
This simple code don't compile (in local), with error:
-----------------------------------
Error: 'Expecting type, got primitive datatype 'float' (parse error)'
in line '21' at character '33' near '+'
in file '\bug.gbas'
         'RETURN check_point_polygon[0].w+check_point_polygon[0].h'
-----------------------------------


It seems that do not accept the passage as parameter of array of structure.

Could you verify?
Thank you
Qedo

Code (glbasic) Select
TYPE cp
w%
h%
ENDTYPE

GLOBAL check_point_polygon[] AS cp
DIM check_point_polygon[1]

check_point_polygon[0].w=12
check_point_polygon[0].h=122

SUB GLB_ON_LOOP:
PRINT stretch_y(check_point_polygon[]),0,100
SHOWSCREEN
ENDSUB


FUNCTION stretch_y:check_point_polygon[]
RETURN check_point_polygon[0].w+check_point_polygon[0].h
ENDFUNCTION

metzzo

Yes because this is syntactically incorrect.

Here is the correct version:
Code (glbasic) Select
TYPE cp
        w%
        h%
ENDTYPE

GLOBAL check_point_polygon[] AS cp
DIM check_point_polygon[1]

check_point_polygon[0].w=12
check_point_polygon[0].h=122

SUB GLB_ON_LOOP:
        PRINT stretch_y(check_point_polygon[]),0,100
        SHOWSCREEN
ENDSUB


FUNCTION stretch_y:check_point_polygon[] AS cp // "AS cp" otherwise it is an double array
        RETURN check_point_polygon[0].w+check_point_polygon[0].h
ENDFUNCTION
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad

#140
It compiles okay now.

It does seem to have trouble with this :
Code (glbasic) Select
c=((255-((s.zPos*255.0)*0.001))*s.zVel)*0.2

It seems assignment using types is a problem, eg :

Code (glbasic) Select
a=s.zPos (with s defined, of course)

This is in a FOREACH loop

Full routine :

Code (glbasic) Select
       FUNCTION Display%:
        LOCAL s AS T3DStar
        LOCAL c
        LOCAL a

            ALPHAMODE -1.0
            FOREACH s IN self.stars[]
                PRINT s.zPos,0,0,TRUE
                    //a=s.zPos // *255.0
                    //c=((255-((s.zPos*255.0)*0.001))*s.zVel)*0.2
                        //SETPIXEL 0,0,0
                        //((s.xPos/s.zPos)*100.0)+(self.screenWidth%*0.5),((s.yPos/s.zPos)*100.0)+(self.screenHeight%*0.5),RGB(c,c,c)

                NEXT     
        ENDFUNCTION

metzzo

#141
Cannot reproduce this bug, would you mind sending me an example code that causes the same issue or something comparable?

Please, before sending bug requests test whether it runs properly with the original GLBasic compiler, because if it does not, it is likely to be a problem with the code itself and not with 123 basic. 123 basic has already successfully a lot of very complex code samples (including ddgui, various samples and 123basic itself - which is around 10000 lines of code that uses every language feature of GLB) and check out the issue tracker on github, a lot of bugs are already known and will be fixed when I've got time
That's no Bug, that's my project!

http://programming-with-design.at/

MrTAToad


Qedo

Coolo,
can you try the program attached?
seem that GETSPRITESIZE don't work.
Qedo

spicypixel

Downloaded the 123-basic-master.zip, have compiled the gbap file. Changed the macro.bat to reflect the location of the 123basic.app compiler. However the first post says that it can be compiled from the IDE yet gives no outline how? Also within the Marcro.bat we have these variables %GLB_PROJ_NAME% %GLB_PROJ_PATH% but no outline whether we set them per project and if so then how can we compile from the ide as these can't be fixed variables then either???

Confused?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

metzzo

#145
Qedo: HTML5 is async, which means the sprite size of image is known when it has properly loaded (GLB_ON_LOOP is then executed). If you want a loading screen use GLB_ON_LOADING and check whether the sprite has loaded with GETSPRITESIZE (which returns the proper size when it has sucessfully loaded the image)
spicypixel: Put the macro.bat into the IDE (blue one for example), when using the macro from the IDE GLB sets the specified variables automatically. For more information read the GLB help file which describes how to set macros in the IDE.
That's no Bug, that's my project!

http://programming-with-design.at/

Qedo

QuoteQedo: HTML5 is async, which means the sprite size of image is known when it has properly loaded (GLB_ON_LOOP is then executed). If you want a loading screen use GLB_ON_LOADING and check whether the sprite has loaded with GETSPRITESIZE (which returns the proper size when it has sucessfully loaded the image)

coolo: strange but the same program without modification works with HTML5 GLB (emscripten).



http://web.tiscali.it/edoardobianchi/STUFF/HTML5/bug/bug.html

Hark0

Hi @coolo, triing my game....

First I make a simple Hello world and works without problems on Win64-Chrome...  :good:

Now... Go for compiling my game to html5! It's very huge...

I have this error:

Code (glbasic) Select
-----------------------------------
Error: 'RESTORE label 'datos_Puertas' unknown. (parse error)'
in line '112' at character '0' near 'NEWLINE'
in file '\Variables.gbas'
         'RESTORE datos_Puertas'
-----------------------------------


And for all RESTORE parts...

Sample of code:
Code (glbasic) Select

Datos_Puertas_Cantidad=4
DIM Datos_Puertas_Descripcion$[Datos_Puertas_Cantidad]
DIM Datos_Puertas_Llaves[Datos_Puertas_Cantidad]

RESTORE Datos_Puertas
FOR n=0 TO Datos_Puertas_Cantidad-1
READ Datos_Puertas_Descripcion$[n]
READ Datos_Puertas_Llaves[n]
NEXT

STARTDATA Datos_Puertas:
DATA "null",0
DATA "Puerta 1 llave",1
DATA "Puerta 2 llaves",2
DATA "Puerta 3 llaves",3
ENDDATA


TIA,  ;)
http://litiopixel.blogspot.com
litiopixel.blogspot.com - Desarrollo videojuegos Indie · Pixel-Art · Retroinformática · Electrónica Development Indie Videogames · Pixel-Art · Retrocomputing · Electronic

DaCarSoft

Hi Hark0!

mmm...   May be that could be a "typo" only in your message here...   But, have you seen that the error is showing "datos_Puertas" with a "D" in low case and your declarations appears to have "D" in upper case???    O_O
"Si quieres resultados distintos... no hagas siempre lo mismo" - Albert Einstein.

mentalthink

#149
I have problems again for compile anything... included the samples files.  :O