2020-12-06 18:41:39 +01:00
|
|
|
// Attaque au corp à corp
|
2020-12-06 20:12:21 +01:00
|
|
|
audio_play_sound(snAttack,1,false);
|
2020-12-06 14:31:54 +01:00
|
|
|
isAttack = true;
|
|
|
|
compteurFrames = 0;
|
2020-12-06 15:50:42 +01:00
|
|
|
tailleEpee = 20; // à définir
|
2020-12-05 16:09:52 +01:00
|
|
|
|
2020-12-06 15:50:42 +01:00
|
|
|
switch (indexImageInfo) {
|
|
|
|
case 0:
|
|
|
|
inst = collision_rectangle(x-5, y, x+5, y+tailleEpee, oMonster, false, oPlayer);
|
2020-12-05 17:19:25 +01:00
|
|
|
//inst = getCollisionArea(x-5, y+tailleEpee, x+5, y+tailleEpee, oMonster);
|
2020-12-06 15:50:42 +01:00
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
inst = collision_rectangle(x, y-5, x+tailleEpee, y+5, oMonster, false, 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, oMonster, false, oPlayer);
|
|
|
|
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
inst = collision_rectangle(x-tailleEpee, y-5, x, y+5, oMonster, false, oPlayer);
|
2020-12-05 17:19:25 +01:00
|
|
|
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
|
2020-12-06 15:50:42 +01:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
inst = noone;
|
2020-12-06 12:38:35 +01:00
|
|
|
}
|
2020-12-05 16:09:52 +01:00
|
|
|
|
|
|
|
if (inst != noone) {
|
2020-12-06 12:38:35 +01:00
|
|
|
hit(self, inst, attack);
|
|
|
|
inst.touche = 30;
|
2020-12-06 18:41:39 +01:00
|
|
|
}
|