4
0
Fork 0

Modification code attaque

This commit is contained in:
rick 2020-12-06 15:50:42 +01:00
parent eb831d9778
commit eb57c2d7c9

View file

@ -3,46 +3,28 @@
//jouer l'animation
isAttack = true;
compteurFrames = 0;
tailleEpee = 30; // à définir
checkCote = image_index / 8; // récupère où regarde le personnage
inst = noone;
tailleEpee = 20; // à définir
if (sprite_index == sPlayerRun) {
if (checkCote <= 1) {
inst = collision_rectangle(x+5, y+tailleEpee, x-5, y+tailleEpee, oMonster, false, oPlayer);
//inst = getCollisionArea(x-5, y+tailleEpee, x+5, y+tailleEpee, oMonster);
} else if (checkCote <= 2) {
inst = collision_rectangle(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster, false, oPlayer);
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster)
} else if (checkCote <= 3) {
inst = collision_rectangle(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster, false, oPlayer);
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster)
} else if (checkCote <= 4) {
inst = collision_rectangle(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster, false, oPlayer);
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
}
} else {
switch (image_index) {
switch (indexImageInfo) {
case 0:
inst = collision_rectangle(x+5, y+tailleEpee, x-5, y+tailleEpee, oMonster, false, oPlayer);
inst = collision_rectangle(x-5, y, x+5, y+tailleEpee, oMonster, false, 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, false, oPlayer);
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster)
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-tailleEpee, oMonster, false, oPlayer);
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster)
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-tailleEpee, y-5, oMonster, false, oPlayer);
inst = collision_rectangle(x-tailleEpee, y-5, x, y+5, oMonster, false, oPlayer);
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
break;
default:
inst = noone;
}
}
if (inst != noone) {
show_debug_message("objet trouvé !");