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.


Topics - bricky91

Pages: [1]
1
GLBasic - en / MinGW problem
« on: 2010-Nov-14 »
Hi guys, I have a problem. I installed minGW in order to get Netbeans work (well, and I didn't even mange to get it wrok...), but now when I try to compile I get this output:
Code: (glbasic) [Select]
/mingw/lib/crt2.o:crt1.c:(.text+0x28): undefined reference to `___dyn_tls_init_callback'Any ideas on how to fix this?  :(

2
GLBasic - en / Game slow on gp2x F200
« on: 2010-Feb-10 »
Hey guys! I have a problem. I'm currently using GL Basic 7.250 and on my gp2x F200 the game I'm making runs very very slow, but I don't know why! Here's the code I wrote, just in case:

Code: (glbasic) [Select]
SETSCREEN 320, 240, FALSE

//------------------------------------------------------
//----------------------RISORSE-------------------------
//------------------------------------------------------
LOADSPRITE "sprites/sp_block-mondo1_sopra.png", 0
LOADSPRITE "sprites/sp_block_mondo1_sotto.png", 1



//------------------------------------------------------
//----------------------VARIABILI-----------------------
//------------------------------------------------------
GLOBAL mx, my, b1, b2
GLOBAL stato_gioco, stato_livello, stato_menu


GLOBAL map_w, map_h
GLOBAL map[], map_red[] //map_red[x][y]=1 -> non si può mettere nulla (nell'editor chiaraente)
GLOBAL ed_item[], ed_item_num, ed_item_timer
GLOBAL scroll_x, scroll_y


//------------------------------------------------------
//----------------------COSTANTI------------------------
//------------------------------------------------------
GLOBAL KEY_RIGHT=205
GLOBAL KEY_LEFT=203
GLOBAL KEY_UP=200
GLOBAL KEY_DOWN=208
GLOBAL KEY_ENTER=28
GLOBAL KEY_SHIFT_DX=54
GLOBAL KEY_SHIFT_SX=42
GLOBAL KEY_TAB=15
GLOBAL KEY_PAGE_UP=201
GLOBAL KEY_PAGE_DOWN=209
GLOBAL KEY_ESC=1

GLOBAL T_SIZE=20
GLOBAL ED_ITEM_MAX=5



DIM ed_item[ED_ITEM_MAX]
DIM map[32][24]
DIM map_red[32][24]




//provvisori------------------
stato_gioco=2
ed_item_num=0
scroll_x=0
scroll_y=0
map_w=32
map_h=24



//------------------------------------------------------
//----------------------MAN LOOP------------------------
//------------------------------------------------------
WHILE stato_gioco<>-1
SELECT stato_gioco
CASE 0 //menu, scelta livello, settaggio editor, carica livello da editor
GOSUB scegli_menu
CASE 1 //gioco vero e proprio
GOSUB ingame
CASE 2 //editor
GOSUB editor
ENDSELECT
SHOWSCREEN
WEND
END





// ------------------------------------------------------------- //
// ---  SCEGLI_MENU  ---
// ------------------------------------------------------------- //
SUB scegli_menu:



ENDSUB // SCEGLI_MENU




// ------------------------------------------------------------- //
// ---  INGAME  ---
// ------------------------------------------------------------- //
SUB ingame:



ENDSUB // INGAME




// ------------------------------------------------------------- //
// ---  EDITOR  ---
// ------------------------------------------------------------- //
SUB editor:


// disegno delle robe dell'edior tipo linee guida e spazi rossi---------------------------------------------
DRAWRECT 0, 0, map_w*T_SIZE, map_h*T_SIZE, RGB(255, 255, 255)

FOR x=0 TO map_w-1
FOR y=0 TO map_h-1
IF map[x][y]=0 //quadratini rossi-> non ci si può piazzare sopra oggetti!
IF y<24-1
IF map[x][y+1]<>map_h-1
DRAWRECT x*T_SIZE-scroll_x, y*T_SIZE-scroll_y, T_SIZE, T_SIZE, RGB(255, 0, 0)
ENDIF
ELSE
DRAWRECT x*T_SIZE-scroll_x, y*T_SIZE-scroll_y, T_SIZE, T_SIZE, RGB(255, 0, 0)
ENDIF
ENDIF


DRAWLINE x*T_SIZE-scroll_x, 0-scroll_y, x*T_SIZE-scroll_x, map_h*T_SIZE-scroll_y, RGB(128, 128, 128) //linee per i quadrati
DRAWLINE x*T_SIZE-1-scroll_x, 0-scroll_y, x*T_SIZE-1-scroll_x, map_h*T_SIZE-scroll_y, RGB(128, 128, 128)
DRAWLINE 0-scroll_x, y*T_SIZE-scroll_y, map_w*T_SIZE-scroll_x, y*T_SIZE-scroll_y, RGB(128, 128, 128)
DRAWLINE 0-scroll_x, y*T_SIZE-1-scroll_y, map_w*T_SIZE-scroll_x, y*T_SIZE-1-scroll_y, RGB(128, 128, 128)
NEXT
NEXT



//fai scorrere gli oggetti dell'editor------------------------------------------------------------------------
IF ed_item_timer>0
DEC ed_item_timer, 1
ELSE
IF KEY(KEY_SHIFT_DX)
IF ed_item_num<ED_ITEM_MAX THEN INC ed_item_num, 1
ed_item_timer=10
ELSEIF KEY(KEY_SHIFT_SX)
IF ed_item_num>0 THEN DEC ed_item_num, 1
ed_item_timer=10
ENDIF
ENDIF



//scrlling----------------------------------------------------------------------------------------------------
IF KEY(KEY_RIGHT)
IF scroll_x<(map_w/2-1)*T_SIZE
INC scroll_x, 4
ELSE
scroll_x=(map_w/2-1)*T_SIZE
ENDIF
ENDIF


ENDSUB // EDITOR

Hwever, I don't think the problem can be realted to the code... Any ideas?

3
Feedback / Nintendo DS compiler
« on: 2010-Jan-17 »
Hey, do you think it could be possible to add the possibility to compile for Nintendo DS? Since I just bought a DS, I thought about this, it would be great! But I don't know if there would be trouble because of the double screen...

4
GLBasic - en / TYPEs question
« on: 2009-Jul-01 »
Hey guys, here I am again. I'll try to explain what I want to do. I'm making a game like "mario vs donkey kong 2" (for the DS). So I sometimes have more than one player to control. The problem is that I have to make them change their direction when they hurt each other. But I can't understad how to do it. I tried to do like this

FOREACH player in players[]
//code...
FOREACH player2 in players[]
//code to reverse the horizontal direction
NEXT
//other code...
NEXT

but, it doesn't work well. I think it's because in the second FOREACH is included also the player of the first FOREACH... So bsically the object checks for collisions with itself, and obviously the object always collides with itself... Any ideas on how to check this kind of collisions?

5
GLBasic - en / ZOOMSPRITE doesn't work
« on: 2009-Jun-28 »
Why doesn't ZOOMSPRITE work on gp2x? Works fine on PC, but when I play the game on gp2x it doesn't work.  :O

6
GLBasic - en / Files reading
« on: 2009-Jun-21 »
Hey guys, I don't understand how to read values form files. This is what I'd like to do: I'd like to create a map, for example for a platform game, by writing some values into a .txt file. For example, this would be my map:

0000000000
0000000000
0000000000
0000000000
0000000000
2000000000
1111111111

0, 1 and 2 are squares of different colors (32*32). How can I read this file and draw the correxponding map in the game?

7
GLBasic - en / TYPE problem
« on: 2009-Feb-04 »
Hey guys, i've a little problem (well, in fact it is a great problem).

I am learing how to use types, and i wrote this code:

Code: (glbasic) [Select]
TYPE player
x
y
vspeed
ENDTYPE

Well, it gives me an error: syntax error at line 19 (line 19 is where i worte "TYPE player"). What's wrong with my code? I can't understand.

Oh and i can't even update using the editor, i also get an error doing this, so tomorrow i'll download the last version and i'll try it. Maybe it won't give the error any more, but i just wanted to understand if there was something wrong with my code.

Thanks, and sorry for my english, I'm italian...  :whistle:

8
GLBasic - en / problem with local variables
« on: 2008-Mar-24 »
hi, i'm making a game with many mini-games... so i use a sub for each minigame... i have a variable  called game, and i assign a minigame to its values... so i wrote:
Code: (glbasic) [Select]
select game
case 1
gosub minigame1
case 2
gosub minigame2

...
endselect
in every minigame i must have variables, so i defined them local; i have a variable called phase that has values 0,1 or 2:
i wrote in sub minigame 1:
Code: (glbasic) [Select]
if phase=0
//just a loading phase: creates all the variables and arrays or load the sprites...
LOCAL score; score=0
LOCAL time; time=2000
...
phase=1
endif

if phase=1
//show the instructions(here is the code to show the instructions)
if key(28)
phase=2
endif
endif

if phase=2
//play the game(and here's is all the code of the real minigame)
if time<0 then phase=0 //go back to the loading phase and to the instructions if there is no more time
endif
but the LOCAL variables don't work,.. the time should be 2000 at the beginning of the game, and it is 0. so it returns to the instructions... why does it happen? if i define the variables as global variables then it works ok... but if i define them LOCAL the game doesn't work...

9
GLBasic - en / text with some lines
« on: 2008-Mar-23 »
hi! is there a function to write a text with more than a line? like this

this is a
text with
3 lines

how can i make this? is there a symbol to put in the PRINT function to stars a new line?
thenks bye!

10
GLBasic - en / FOR problem
« on: 2008-Feb-21 »
hi guys, i have aproblem with this code


Code: (glbasic) [Select]
LOADSPRITE "lana.bmp",0

GLOBAL n_lana
DIM lanax[5]
DIM lanay[5]
DIM lana_xscale[5]
DIM lana_yscale[5]
DIM lana_exists[5]
DIM lana_ricrea[5]

GLOBAL click







WHILE TRUE
GOSUB muovi
SHOWSCREEN
WEND




// ------------------------------------------------------------- //
// ---  MUOVI  ---
// ------------------------------------------------------------- //
SUB muovi:

MOUSESTATE mx,my,b1,b2



IF b1=FALSE
click=0
ENDIF


IF n_lana<4
n_lana=n_lana+1
lanax[n_lana]=RND(640)
lanay[n_lana]=RND(480)
lana_xscale[n_lana]=1
lana_yscale[n_lana]=1
lana_exists[n_lana]=1
lana_ricrea[n_lana]=0
ENDIF


FOR i=1 TO n_lana

lana_yscale[i]=lana_xscale[i]

IF lana_exists[i]=1
IF lana_xscale[i]>0
IF b1 AND click=0
IF mxlanax[i]-32 AND mylanay[i]-32
lana_xscale[i]=lana_xscale[i]-0.1
ENDIF
click=1
ENDIF

ELSE

lana_exists[i]=0
lana_ricrea[i]=120

ENDIF
ENDIF


IF lana_exists[i]=0
lana_ricrea[i]=lana_ricrea[i]-1
ENDIF

IF lana_ricrea[i]<0
lana_ricrea[i]=0
lana_exists[i]=1
lana_xscale[i]=1
ENDIF


ZOOMSPRITE 0,lanax[i]-32,lanay[i]-32,lana_xscale[i],lana_yscale[i]


PRINT lana_exists[i],lanax[i],lanay[i]
PRINT lana_xscale[i],lanax[i]-64,lanay[i]-64

NEXT


DRAWRECT mx,my,10,10,RGB(255,255,255)


ENDSUB // MUOVI
i want 4 sheeps(in this code there isn't any sheep) that go around the scrreen, and i made it... it works fine... now i want the wool of the sheeps, so in the game you have to shear the sheeps... here begins the problem... with the code i wrote, i can shear only the first sheep, and when the first sheep has no wool, i can shear the second... but i don't want to shear the sheeps in order... how can i modify the code so that i can shear the sheep i want? i think the probelm is in the FOR statement... but i can't correct the code...

11
Beta Tests / space war
« on: 2008-Feb-04 »
hi! i made this little space shooter called space war; here's the link:

http://www.zshare.net/download/7200375fc6b51b/

tell me how it is, if you find bugs, and wathever you want! :)

12
GLBasic - en / alignement
« on: 2008-Feb-01 »
Hi! i have another question: is it possible to set the alignement of the text??
thanks bye :)

13
GLBasic - en / problem with shots
« on: 2008-Jan-30 »
Hello guys, i'm new here! oh, and i'm italian, so my english isn't very good ^^
however, i've started using GL Basic a few days ago, but i have some experience with game maker, using only scripts(without objects), and it is quite similar.
i made a pong game by myself, and it wasn't difficult, so i decided to make a shooter... but i have a problem... i wrote this code:
Code: (glbasic) [Select]
GOSUB init

main:
GOSUB muovi
GOSUB mostra
GOTO main





// ------------------------------------------------------------- //
// ---  INIT  ---
// ------------------------------------------------------------- //
SUB init:


//settiamo variabili e quant'altro*******************************************************************+

//giocatore
plx=320
ply=380

//colpi
n=0
puoisparare=60


ENDSUB // INIT




// ------------------------------------------------------------- //
// ---  MUOVI  ---
// ------------------------------------------------------------- //
SUB muovi:

//giocatore********************************************************************************************

//movimento

IF KEY(203) AND plx>8
plx=plx-4
ENDIF

IF KEY(205) AND plx<630
plx=plx+4
ENDIF

IF KEY(200) AND ply>10
ply=ply-2
ENDIF

IF KEY(208) AND ply<470
ply=ply+2
ENDIF


//sparo

IF puoisparare>0
puoisparare=puoisparare-1        
ENDIF

IF KEY(30) AND puoisparare=0
n=n+1
colpox[n]=plx
colpoy[n]=ply
puoisparare=60
ENDIF


//muoviamo i colpi verso l'alto e distruggiamoli se fuori*****************************************
FOR i=1 TO n
colpoy[i]=colpoy[i]-6
NEXT




ENDSUB // MUOVI






// ------------------------------------------------------------- //
// ---  MOSTRA  ---
// ------------------------------------------------------------- //
SUB mostra:

//disegna la navetta del giocatore
DRAWRECT plx-8,ply-10,16,20,RGB(0,255,0)

//disegna i colpi
FOR i=1 TO n
DRAWRECT colpox[i]-2,colpoy[i]-2,4,4,RGB(0,255,0)
NEXT
 
PRINT puoisparare,100,100
//mostra tutto
SHOWSCREEN


ENDSUB // MOSTRA
the main variables are:

plx= player x position
ply=  player y position
n= shot number(first, second, third,...)
puoisparare= if the value of this variable is 0, then you can shoot.

SUBS
muovi = here are the keyboard controls
mostra= here is all the graphic
init= give the variables the start values

the problem become when i try to shoot... i press the A button, and when the variable puoisparare is equal to 0 the window is closed and the game stop... why does it happen?? what am i doing wrong?

thanks all, bye!

Pages: [1]