Files
q1k3/source/entity_pickup_key.js
T

26 lines
397 B
JavaScript
Raw Normal View History

2021-09-13 09:34:08 +02:00
class entity_pickup_key_t extends entity_pickup_t {
_init() {
super._init();
this._texture = 21;
this._model = model_pickup_key;
}
_update() {
this._yaw += 0.02;
super._update();
}
_pickup() {
audio_play(sfx_pickup);
game_show_message('YOU GOT THE KEY!');
for (let e of game_entities) {
if (e._needs_key) {
e._needs_key = 0;
break;
}
}
this._kill();
}
}