Modification code attaque
This commit is contained in:
parent
eb831d9778
commit
eb57c2d7c9
1 changed files with 18 additions and 36 deletions
|
@ -3,45 +3,27 @@
|
||||||
//jouer l'animation
|
//jouer l'animation
|
||||||
isAttack = true;
|
isAttack = true;
|
||||||
compteurFrames = 0;
|
compteurFrames = 0;
|
||||||
tailleEpee = 30; // à définir
|
tailleEpee = 20; // à définir
|
||||||
checkCote = image_index / 8; // récupère où regarde le personnage
|
|
||||||
inst = noone;
|
|
||||||
|
|
||||||
if (sprite_index == sPlayerRun) {
|
switch (indexImageInfo) {
|
||||||
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) {
|
|
||||||
case 0:
|
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);
|
//inst = getCollisionArea(x-5, y+tailleEpee, x+5, y+tailleEpee, oMonster);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
inst = collision_rectangle(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster, false, oPlayer);
|
inst = collision_rectangle(x, y-5, x+tailleEpee, y+5, oMonster, false, oPlayer);
|
||||||
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster)
|
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
inst = collision_rectangle(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster, false, oPlayer);
|
inst = collision_rectangle(x-5, y-tailleEpee, x+5, y, oMonster, false, oPlayer);
|
||||||
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster)
|
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster);
|
||||||
break;
|
break;
|
||||||
case 3:
|
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);
|
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
inst = noone;
|
inst = noone;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inst != noone) {
|
if (inst != noone) {
|
||||||
|
|
Reference in a new issue