30 lines
No EOL
756 B
Text
30 lines
No EOL
756 B
Text
// 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);
|
|
break;
|
|
case 1:
|
|
inst = collision_rectangle(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster, true, oPlayer);
|
|
break;
|
|
case 2:
|
|
inst = collision_rectangle(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster, true, oPlayer);
|
|
break;
|
|
case 3:
|
|
inst = collision_rectangle(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster, true, oPlayer);
|
|
break;
|
|
default:
|
|
inst = noone;
|
|
}
|
|
|
|
if (inst != noone) {
|
|
show_debug_message("objet trouvé !");
|
|
// attaque
|
|
} else {
|
|
//a supp
|
|
show_debug_message("pas d'objet...");
|
|
} |