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
|
||||
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) {
|
||||
|
|
Reference in a new issue