Oh great, thank you, I installed the previous version of minGW and now it works. Thanks!

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/mingw/lib/crt2.o:crt1.c:(.text+0x28): undefined reference to `___dyn_tls_init_callback'
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
Quote from: Nobiag on 2009-Jul-01For mastercheck=0 to bounds(players[],0)-1
if mastercheck<bounds(players[],0)-1
For slavecheck=mastercheck+1 to bounds(players[],0)-1
//blabla... check collision...
next
endif
next
Thats how i would do it. This way every combination of players will just be checked once, because the second "For to..." starts one step after the mastercheck.
With 4 Players it would look like this:
1+2
1+3
1+4
2+3
2+4
3+4
Quote from: Moru on 2009-Jun-23
worm.zip contains a source.zip file, unpack this and load it up in GLBasic and you should see the load_level function. It reads the size and some options and then the level data. draw_screen draws the map on the screen.
Quote from: Kitty Hello on 2009-Jun-22
Read a text file to an array:
LOCAL map%[]
DIM map%[11][11]
IF OPENFILE 0, "the.map"
FOR y%=0 to 10 // 11 lines
READLINE 0, line$
FOR x%=0 TO 10 // 11 coloums - change to fit your file
map%[x][y] = mid$(line$, x, 1) // convert one digit to a number - adjust to your needs. Maybe 2 digits per whatever...
NEXT
NEXT
ENDIF
Improvements: Read/write binary data, maybe?
Read 2 digits for a number instead
read/write the width/height of the map at the top of the file
read and compare a file header
IF OPENFILE...
...
ENDIF