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) {
|
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);
|
||||||
} else if (checkCote <= 2) {
|
break;
|
||||||
inst = collision_rectangle(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster, false, oPlayer);
|
case 1:
|
||||||
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster)
|
inst = collision_rectangle(x, y-5, x+tailleEpee, y+5, oMonster, false, oPlayer);
|
||||||
} else if (checkCote <= 3) {
|
//inst = getCollisionArea(x+tailleEpee, y+5, x+tailleEpee, y-5, oMonster);
|
||||||
inst = collision_rectangle(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster, false, oPlayer);
|
break;
|
||||||
//inst = getCollisionArea(x+5, y-tailleEpee, x-5, y-tailleEpee, oMonster)
|
case 2:
|
||||||
} else if (checkCote <= 4) {
|
inst = collision_rectangle(x-5, y-tailleEpee, x+5, y, oMonster, false, oPlayer);
|
||||||
inst = collision_rectangle(x-tailleEpee, y+5, x-tailleEpee, y-5, 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);
|
||||||
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
|
//inst = getCollisionArea(x-tailleEpee, y+5, x-tailleEpee, y-5, oMonster);
|
||||||
}
|
break;
|
||||||
} else {
|
default:
|
||||||
switch (image_index) {
|
inst = noone;
|
||||||
case 0:
|
|
||||||
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);
|
|
||||||
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)
|
|
||||||
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)
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
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);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
inst = noone;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (inst != noone) {
|
if (inst != noone) {
|
||||||
|
|
Reference in a new issue