I've tryed to do this afret read planet survivor from an aum.
Code:
Function Shoot_me
{
var Shoot_Speed=40;
my.pan = -90;
My.facing = on;
my.event = hit;
my.enable_entity=on;
my.passable=on;
my.push=1;
my.skill3=1;
my.scale_x=0.3;
my.scale_y=0.3;
my.scale_z=0.5;
my.light=on;
my.lightrange=50;
my.red=0;
my.green=0;
my.blue=50;
my.flare=on;
my.transparent=on;
my.alpha=40;
my.bright=on;
my.light=on;
while(my && Player)
{
c_move(me,vector(shoot_speed*time_step,0,0),nullvector,Ignore_Push );
if (my.y>=(player.y+600))
{
ent_remove(my);
}
wait(1);
}
}
Function Hit
{
wait(1);
my.event = null;
ent_remove(my);
}
This's the code for the player bullet, it must delete itself when it something, but when i try the game, it move and don't do nothing.
Code:
function move_bulletD()
{
var bullet_speed;
my.push=1;
my.skill3=1;
my.scale_x=0.3;
my.scale_y=0.3;
my.scale_z=0.3;
my.passable = on;
my.enable_impact = on;
my.enable_entity = on;
my.event = hit;
my.pan = you.pan;
bullet_speed.x = 0 ;
bullet_speed.y = 12;
bullet_speed.z = 0;
my.ambient = 100;
my.bright = on;
my.light = on;
my.red = 50;
my.green = 255;
my.blue = 50;
while (my != null) // as long as the bullet exists
{
if (you != null)
{
if(vec_dist (my.y, you.y) > 150)
{
my.passable = off;
}
if(vec_dist(my.y, you.y) > 1000)
{
ent_remove(me);
}
}
move_mode = ignore_you + ignore_passable;
ent_move (bullet_speed, nullvector);
wait (1);
}
}
That's the enemy bullet, it must do the same thing of player bullet, but it delete itself after it become unpassable.
Code:
function destroy_them {
if (my.skill40 == 1) {
ent_remove(my);
}
if (my.skill40 == 2) {
my.skill20 -= 10; // decrease the shield
my.ambient = 100;
sleep (0.2);
my.ambient = -100;
if (my.skill20 <= 0)
{
ent_create(explosion_pcx, vector(my.x, my.y, my.z), animate_explosion);
snd_play(whamm, 50, 0);
}
}
}
And for the erase of enemy too, if a enemy ship was hitten, it must explode, but nothing happen.
Something's wrong?
How can i do?
I'm trying to fix but with no results