Files
q1k3/source/entity_enemy_grunt.js
T

22 lines
494 B
JavaScript
Raw Normal View History

2021-09-13 09:34:08 +02:00
class entity_enemy_grunt_t extends entity_enemy_t {
_init(patrol_dir) {
super._init(patrol_dir);
this._model = model_grunt;
this._texture = 17;
this._health = 40;
}
_attack() {
this._play_sound(sfx_shotgun_shoot);
game_spawn(entity_light_t, vec3_add(this.p, vec3(0,30,0)), 10, 0xff)._die_at = game_time + 0.1;
for (let i = 0; i < 3; i++) {
this._spawn_projectile(
entity_projectile_shell_t, 10000,
Math.random()*0.08-0.04, Math.random()*0.08-0.04
);
}
}
}