DONE::
I need to achieve this:
I want to show bullet images in a row according to bullets I have. Like an indicator how much bullets I have in a cartridge.
I tried this way. Engine compiles but nothing shows up. Definitely something missing here.
BMAP* hud_bullet = "bullet_ico.png"; //load an image
var bullets = 5; //bullet counter
PANEL* bul_panel[9]; //predefine panels' pointers? (9 because 9 is the max "bullet image count" in the game)
//try to create panels here and display them
function reload()
{
var a;
//make as many icons as I have bullets:
for (a=0; a < bullets; a+=1)
{
PANEL* panel = pan_create(NULL, 101); //Create a panel in runtime
//panel.layer = 101;
panel.bmap = hud_bullet; //(bmap_create("frame.pcx");
panel.pos_x = 366 - 7*a; //Position it according to "for loop" state.
set(panel, SHOW); //display the current created panel
bul_panel[a] = panel; //trying to save current panel pointer to predefined pointer, so I could manage the specific one later on, like: reset(bul_panel[3], SHOW); So the 3-rd bullet is gone, when it's shot etc.
wait(1);
}
}
Any Idea how to fix/create that?
DONE::
-----------------------------------------------
Array issue:
My problem is I don't get that value I try to access.
f.i. I have defined:
var arr[2][2];
//set values:
arr[0][0] = 5;
arr[0][1] =10;
and I want to get certain array value:
add_on = arr[0][g_type]; //g_type is whether 0 or 1.
I don't get the value... add_on is 0 when it should be 10 when g_type is f.i 1.
Last edited by Crypton; 06/26/09 20:32.