Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - Jonás Perusquía

#21
when i had the idea of creating a game, i searched for an easy-to-code programming languaje and found BASIC useful, after searching "BASIC GAME" i found DarkBasic and i liked it a lot!

I started playing with it, but then i though that if i wanted to share my app with non-Windows users, i wouldn´t be able to do that, but then something happened:
searching the DarkBasic forums, found a user that was talking about GLBasic... i read what he was posting and i got interested...

after circling the GLBasic website.. i got in love!!!

so i moved here, to GLBasic awesome world...

but again i though... "¿What if i want to write a UI program?" then i got sad :(

but after searching some type of DLL for GLBasic.. found DDgui!!!


MAN! my dream came true! i wanted a BASIC languaje with:

-multiplatform support
-small executables
-3D support
-UI support

now GLBasic is THE BEST SDK i have ever seen!
#22
Hola chicos, una preguntita...

cuando tu compilas una aplicación para android que requiere 3 archivos, pero en la carpeta Media tengo 1000 archivos ¿Todos se guardan en la aplicación final?
#23
Hola mis queridos amigos, estoy haciendo un juego que empezó solamente como una prueba de código....

Lo que quiero hacer es que controles un pequeño sprite "medal.png" con el mouse y cuando toque cualquiera de los cuadritos verdes callendo "DRAWREC" salga Game Over

Ustedes saben que GLBasic se maneja por coordenadas...

El problema que tengo es que no puedo lograr que cuando un rectangulo verde toque al sprite, salga GameOVer...

Lo que he logrado es que cuando la posición del mouse sea igual a cualquier parte de rectangulo, aparezca GameOver

no se si me estoy explicando bien, pero el problema es que la mitad del sprite puede estar dentro de un rectangulo verde, pero no saldrá GameOver si la posición del mouse no está dentro del rectangulo... ese es el problema

éste es el código de mi juego:
Code (glbasic) Select
SETCURRENTDIR("Media") // go to media files
LOADFONT "smalfont.png", 0
LOADSPRITE "medal.png", 0
GLOBAL sx,sy,mx,my,b1,b2,y,x,x2,y2,x3,y3,rx,ry
GETSCREENSIZE sx,sy
SETFONT 0
LIMITFPS 60
PLAYMUSIC "ditrabox2.mp3", TRUE
//--- VARIABLES ---//
y=-20
x=RND((sx-15)+5)
x2=RND((sx-15)+5)
y2=-20
x3=RND((sx-15)+5)
y3=-20
rx=30
ry=60
GOSUB menu


//--- MENU ---//
SUB menu:
CLEARSCREEN RGB(0,0,0)
PRINT "Start Game", sx/2-30,sy/2
SHOWSCREEN
MOUSEWAIT
GOSUB game
ENDSUB


//--- OBJETOS Y MOVIMIENTO ---//
SUB game:
WHILE y < sy+30

MOUSESTATE mx,my,b1,b2

DRAWSPRITE 0, mx,my

//--- RECTANGULOS VERDES ---//
DRAWRECT x,y, rx, ry, RGB (100,244,100)
DRAWRECT x2,y2, rx, ry, RGB (100,244,100)
DRAWRECT x3,y3, rx, ry, RGB (100,244,100)

y=y+3
y2=y2+4
y3=y3+5

SHOWSCREEN

CLEARSCREEN
//--- OPCIONES CUADRO 1---//
IF y >= sy+30
y=-20
ENDIF

//--- OPCION 1 FIN ---//
IF mx >= x AND mx <= x+30
IF my >= y AND my <= y+60
CLEARSCREEN RGB(149,0,0)
PRINT "GAME OVER", sx/2-30,sy/2
SHOWSCREEN
MOUSEWAIT
GOSUB menu
ENDIF
ENDIF

//--- NUEVA POSICIÓN ---//
IF y=-20
x=RND((sx-15)+5)
ENDIF

//--- OPCIONES CUADRO 2---//
IF y2 >= sy+30
y2=-20
ENDIF

//--- OPCION 2 FIN ---//
IF mx >= x2 AND mx <= x2+30
IF my >= y2 AND my <= y2+60
CLEARSCREEN RGB(149,0,0)
PRINT "GAME OVER", sx/2-30,sy/2
SHOWSCREEN
MOUSEWAIT
GOSUB menu
ENDIF
ENDIF

//--- NUEVA POSICIÓN ---//
IF y2=-20
x2=RND((sx-15)+5)
ENDIF

//--- OPCIONES CUADRO 3---//
IF y3 >= sy+30
y3=-20
ENDIF

//--- OPCION 3 FIN ---//
IF mx >= x3 AND mx <= x3+30
IF my >= y3 AND my <= y3+60
CLEARSCREEN RGB(149,0,0)
PRINT "GAME OVER", sx/2-30,sy/2
SHOWSCREEN
MOUSEWAIT
GOSUB menu
ENDIF
ENDIF

//--- NUEVA POSICIÓN ---//
IF y3=-20
x3=RND((sx-15)+5)
ENDIF
WEND
ENDSUB
#24
Feedback / IF command bug
2012-May-01
Hi everyone and Gernot

i was coding a game, when it stopped compiling because an IF didn´t had ENDIF
i searched for the error, but couldn´t find it and couldn´t fix it since the ENDIF was there...

here´s the piece of code where the bug lays:
Code (glbasic) Select
SUB fin3:
IF my-10 > y3-1 AND my+71 > y3+60
CLEARSCREEN RGB(149,0,0)
PRINT "GAME OVER", sx/2-20,sy/2
ENDIF
ENDSUB


Code (glbasic) Select
*** Configuration: WIN32 ***
precompiling:
GPC - GLBasic Precompiler V.9.829 SN:71fa70a5 - 3D, NET
"TEST2.gbas"(77) error : IF without ENDIF / THEN


i though it was my fault, but now i think this is a bug of GLBasic..

¿What do you think?
#25
2D / real font
2012-Apr-29
hi, i make this suggestion having in mind it is possible and easy to implement, however i dont know if it really is...

i suggest real font for GLBasic

just like:

Code (glbasic) Select
LOADFONT "Comic Sans MS", 1
SETFONT 1
SETFONTSIZE 18
PRINT *"Hello "* + "Hello"

* = bold
result:

Hello Hello
#26
2D / window control request
2012-Apr-27
i have a request wich i hope you would like:


GETWINDOWSIZE -> this gives you the current size of the window in two variables, so you can manage different sizes easy..

with this command you should be able to add controls such as:

CHANGE WINDOW SIZE:

800x600
640x480
personalized: ___x___

like?
#27
Bueno, hago este post para pedirles su ayuda amigos de GLBasic, ya que he escrito un código que tiene 3 opciones, en 3 IF diferentes, el problema es que solo es usable la opción 1, las demás solo aparece en negro... se supone que la opcion 3 debe de SALIR, pero no lo hace...

aqui el código:
Code (glbasic) Select
//--MAIN COMMANDS
SETCURRENTDIR("Media")
LIMITFPS 60
LOADFONT "smalfont.png", 0
GETSCREENSIZE sx,sy
//--variables
GLOBAL sx,sy

//--CODE STARTS

PRINT "Presiona una tecla para continuar", sx/2-130,sy/3
SHOWSCREEN
KEYWAIT
GOTO menu

menu:
CLEARSCREEN
LOCAL x$,r$
PRINT "Bienvenido aventurero! Dime, ¿Cual es tu nombre?", sx/2-170,sy/4
INPUT x$, sx/2-50,sy/2
SHOWSCREEN
PRINT "Excelente! Bienvenido " + x$ + "!", sx/2-140,sy/3
SHOWSCREEN
KEYWAIT
GOTO ops

ops:
CLEARSCREEN
PRINT "Despiertas en tu casa vacía, y te diriges a la cocina...",sx/5,sy/3
PRINT "¿Qué deseas hacer?",sx/5, sy/3+30
PRINT "a) Comer manzana",sx/5,sy/3+50
PRINT "b) Beber agua",sx/5,sy/3+60
PRINT "c) Salir de PRUEBA",sx/5,sy/3+70
INPUT r$,sx/5,sy/3+90
SHOWSCREEN

WHILE TRUE
IF r$ = "a" THEN PRINT "chop* chop* chop*", sx/5,sy/3+110
SHOWSCREEN
KEYWAIT
GOTO ops

IF r$ = "b" THEN PRINT "gulp* gulp* gulp*", sx/5,sy/3+110
SHOWSCREEN
KEYWAIT
GOTO ops

IF r$ = "c" THEN PRINT "Gracias por testear PRUEBA!", sx/5,sy/3+110
SHOWSCREEN
KEYWAIT
END
WEND
#28
al igual que existe GETSCREENSIZE, tambien existe algo para obtener las dimensiones de la ventana?

algo como GETWINDOWSIZE o algo asi?
#29
hola, quisiera que alguien porfavor me explicara como crear y usar una font, pues al hacerlo, la font no es aplicada en el programa final y no se porque :/


Code (glbasic) Select

LOADFONT "smalfont.png", 1
SETFONT 1
PRINT "Hola", 100, 100
#30
Hi people, i would really like to ask:

¿When will be released the new GLBasic version?

hope Kitty Hello see this :D
if someone knows, please tell me :)

thank you!
#31
I can´t find the errors in my code... can you please help me?

Code (glbasic) Select
// ***** Included Source File *****
GETFONTSIZE 30,30
PRINT 100,200, "Presiona una tecla para comenzar"
KEYWAIT
CLEARSCREEN
GETFONTSIZE 28,28
RGB (255,0,0)
PRINT "Bienvenido aventurero! Dime, ¿Cual es tu nombre?", 100,100
INPUT varnombre$, 100,104
PRINT "Excelente! Bienvenido a PRUEBA " + varnombre$, 100, 108
KEYWAIT
CLEARSCREEN
PRINT "Estas solo en tu casa, ¿Que deseas hacer?", 100, 50
PRINT "a) Comer palomitas", 100, 55
PRINT "b) Bailar", 100, 60
PRINT "c) Salir del juego", 100, 65
a$= "a"
b$= "b"
c$= "c"
INPUT x$, 100, 70
IF x$ = a$ THEN PRINT "*Chomp, chomp, chomp*",100, 79
INPUT x$, 100, 70
IF x$ = b$ THEN PRINT "*zap, zappa, zap*", 100, 85
INPUT x$, 100, 70
IF x$ = c$ THEN CLEARSCREEN
PRINT "Estas a punto de salir de PRUEBA", 100, 100
KEYWAIT
CLEARSCREEN
END