Ajout du pushback et de la perte de hp quand on touche un monstre
This commit is contained in:
parent
758f4e760a
commit
c2f0c452ae
4 changed files with 20 additions and 1 deletions
16
objects/oPlayer/Collision_oMonster.gml
Normal file
16
objects/oPlayer/Collision_oMonster.gml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
if (pdv <= 0) {
|
||||||
|
instance_destroy();
|
||||||
|
show_debug_message("game overe");
|
||||||
|
// GAME OVER
|
||||||
|
} else {
|
||||||
|
pdv--;
|
||||||
|
if (other.x > x) {
|
||||||
|
x -= 10;
|
||||||
|
} else if (other.x < x) {
|
||||||
|
x += 10;
|
||||||
|
} else if (other.y > y) {
|
||||||
|
y -= 10;
|
||||||
|
} else if (other.y < y) {
|
||||||
|
y += 10;
|
||||||
|
}
|
||||||
|
}
|
0
objects/oPlayer/Collision_oMonsterMelee.gml
Normal file
0
objects/oPlayer/Collision_oMonsterMelee.gml
Normal file
2
objects/oPlayer/Collision_oWall.gml
Normal file
2
objects/oPlayer/Collision_oWall.gml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
/// @description Insérez la description ici
|
||||||
|
// Vous pouvez écrire votre code dans cet éditeur
|
|
@ -1 +1,2 @@
|
||||||
seDeplace = 0;
|
seDeplace = 0;
|
||||||
|
pdv = 100;
|
Reference in a new issue