0 registered members (),
17,416
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
kindly convert this to C script please...
#249181
01/31/09 19:34
01/31/09 19:34
|
Joined: Jan 2009
Posts: 33 Philippines, Quezon City
Kaizen_31
OP
Newbie
|
OP
Newbie
Joined: Jan 2009
Posts: 33
Philippines, Quezon City
|
action enemy_action()// attached to the dummy enemy that is sensitive to player's sword { my.healthpoints = 50; // give the enemies few health points - they'll die immediately while (my.healthpoints > 0) // still alive? { vec_set(temp, player.x); vec_sub(temp, my.x); vec_to_angle(my.pan, temp); // rotate towards the player at all times my.tilt = 0; wait (1); } my.passable = on; // the corpse can't be hit by the sword from now on; the enemy is dead here snd_play (dead_wav, 50, 0); // sword sound while (my.skill10 < 99) { ent_animate(my, "death", my.skill10, null); my.skill10 += 4 * time_step; // "death" animation speed wait (1); } my.transparent = on; my.alpha = 100; while (my.alpha > 0) { my.alpha -= 4 * time_step; wait (1); } ent_remove (my); }
|
|
|
Re: kindly convert this to C script please...
[Re: Kaizen_31]
#249183
01/31/09 19:46
01/31/09 19:46
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
C-Script:
action enemy_action // attached to the dummy enemy that is sensitive to player's sword
{
my.healthpoints = 50; // give the enemies few health points - they'll die immediately
while (my.healthpoints > 0) // still alive?
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp); // rotate towards the player at all times
my.tilt = 0;
wait (1);
}
my.passable = on; // the corpse can't be hit by the sword from now on; the enemy is dead here
snd_play (dead_wav, 50, 0); // sword sound
while (my.skill10 < 99)
{
ent_animate(my, "death", my.skill10, null);
my.skill10 += 4 * time_step; // "death" animation speed
wait (1);
}
my.transparent = on;
my.alpha = 100;
while (my.alpha > 0)
{
my.alpha -= 4 * time_step;
wait (1);
}
ent_remove (my);
}
Lite-C:
action enemy_action() // attached to the dummy enemy that is sensitive to player's sword
{
my.healthpoints = 50; // give the enemies few health points - they'll die immediately
while (my.healthpoints > 0) // still alive?
{
vec_set(temp, player.x);
vec_sub(temp, my.x);
vec_to_angle(my.pan, temp); // rotate towards the player at all times
my.tilt = 0;
wait (1);
}
set(my,PASSABLE); // the corpse can't be hit by the sword from now on; the enemy is dead here
snd_play (dead_wav, 50, 0); // sword sound
while (my.skill10 < 99)
{
ent_animate(my, "death", my.skill10, NULL);
my.skill10 += 4 * time_step; // "death" animation speed
wait (1);
}
set(my,TRANSLUCENT);
my.alpha = 100;
while (my.alpha > 0)
{
my.alpha -= 4 * time_step;
wait (1);
}
ent_remove (my);
}
Last edited by Xarthor; 01/31/09 19:47.
|
|
|
|