4
0
Fork 0
This repository has been archived on 2023-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
surprise_dungeon/objects/oPlayer/KeyPress_74.gml

46 lines
1.3 KiB
Text
Raw Normal View History

// Attaque au corp à corp
//jouer l'animation
tailleEpee = 20; // à définir
switch (image_index) {
case 0:
inst = collision_rectangle(x+5, y+tailleEpee, x-5, y+tailleEpee, oMonster, true, oPlayer);
//inst = getCollisionArea(x-5, y+tailleEpee, x+5, y+tailleEpee, oMonster);
break;
case 1:
inst = collision_rectangle(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster, true, oPlayer);
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster)
break;
case 2:
inst = collision_rectangle(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster, true, oPlayer);
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster)
break;
case 3:
inst = collision_rectangle(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster, true, oPlayer);
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
break;
default:
inst = noone;
}
if (inst != noone) {
show_debug_message("objet trouvé !");
// attaque
} else {
//a supp
show_debug_message("pas d'objet...");
}
/*
if (inst != noone && !ds_list_empty(inst)) {
show_debug_message("objet trouvé !");
show_debug_message(inst);
with (inst) instance_destroy();
// attaque
} else {
//a supp
show_debug_message("pas d'objet...");
}
*/