(edit - ok i think i see where i went wrong, i am going to try to work on that, but i am open to suggestions...=D)

(edit 2 - i updated my program, but it still isnt working...im not sure how to globally declare the panel's position...any help on this area will be appreciated)


I tried that, but now if messes up my whole program - I will post what i have tho:

Quote:
#include <acknex.h>
int v, h, k, p, w;
var player_score = 0;
FONT* digital_font = "digital.pcx";

PANEL* main_char=
{
bmap = "enemy_ship1.bmp"; //this is where you write the name of the picture you want for the main character
layer = 11;
pos_x = 0; // x position for the char
pos_y = 100; // y position for the char
flags = SHOW | OVERLAY;
}

function update_player(PANEL *paddle,var paddle_mode,var key) //this function updates the player
{
{

paddle.pos_x += 30*time_step*key;
paddle.pos_x = clamp(paddle.pos_x,0,700);
v = paddle.pos_x;
//printf("%d", v);
}

}

//function delete_enemy
//{

//}
#define USER 1

var mode_player = USER;

//PANEL* mybullet =
//{
//layer=3;
//flags=OVERLAY,SHOW;
//bmap="missile2.bmp";
//}

void run_bullet()
{



PANEL *mybullet = pan_create( "bmap=missile2.bmp; flags=VISIBLE | OVERLAY; pos_y = 130;", 11);
mybullet.pos_x = v+15;

//h = v + 15;

//k = mypanel.pos_y;




while( mybullet->pos_y < screen_size.y )
{
mybullet->pos_y += 15 * time_step;
wait(1);
}

}

//PANEL* myenemy =
//{
//layer=3;
//flags=OVERLAY,SHOW;
//bmap="ship3.bmp";
//}


void run_enemy()
{

PANEL *myenemy = pan_create( "bmap=ship3.bmp; flags=VISIBLE | OVERLAY; pos_y = 350; pos_x = 790;", 11);

//p = mypanel.pos_x;
//w = mypanel.pos_y;

while( myenemy->pos_x < screen_size.x )
{
myenemy->pos_x -= 4 * time_step;
wait(1);
}

}


function main ()
{
//int v;
int enemy_count=0,create_counter=0;

while (enemy_count < 15)
{
update_player(main_char, mode_player, key_d-key_a); // makes d and a the keys to be pressed in order to move the player
wait (1);

create_counter++;



if ((mybullet.pos_x + mybullet.size_x >= myenemy.size_x) || (mybullet.size_x <= myenemy.pos_x + myenemy.size_x))
if((mybullet.pos_y + mybullet.size_y >= myenemy.size_y) || (mybullet.size_y <= myenemy.pos_y + myenemy.size_y))
{
// printf("hit");
}
if (create_counter%600 == 0)
{
run_enemy();
enemy_count++; //

}
if (key_v)
{
if (create_counter%100 == 0)
{

run_bullet();

}
}
else if (key_esc) { sys_exit(NULL); }


}
}





thanks for taking the time to help!

Last edited by Doof_Guy; 05/23/10 02:47.

To see what 3d models i have made and animated, see the link to my bloghttp://championsdawn.blogspot.com