From 560195ff08f0ff8f0612dc905225fd1f06a5008f Mon Sep 17 00:00:00 2001 From: sOlaris38 Date: Sun, 6 Dec 2020 19:53:51 +0100 Subject: [PATCH] coffre ne reapparait plus --- objects/oChest/Collision_oPlayer.gml | 1 + objects/oChest/Create_0.gml | 1 + objects/oChest/oChest.yy | 1 + objects/oGame/Create_0.gml | 2 ++ objects/oGame/Step_0.gml | 4 ++++ objects/oTransition/Collision_oPlayer.gml | 2 +- 6 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 objects/oChest/Create_0.gml diff --git a/objects/oChest/Collision_oPlayer.gml b/objects/oChest/Collision_oPlayer.gml index c361a3b..fa6648a 100644 --- a/objects/oChest/Collision_oPlayer.gml +++ b/objects/oChest/Collision_oPlayer.gml @@ -1,2 +1,3 @@ +oGame.coffre[oGame.posX, oGame.posY] = 0; if (global.weapon < 3) global.weapon ++; instance_destroy(self); \ No newline at end of file diff --git a/objects/oChest/Create_0.gml b/objects/oChest/Create_0.gml new file mode 100644 index 0000000..8ae6e58 --- /dev/null +++ b/objects/oChest/Create_0.gml @@ -0,0 +1 @@ + if (oGame.coffre[oGame.posX, oGame.posY] = 0) instance_destroy(self); \ No newline at end of file diff --git a/objects/oChest/oChest.yy b/objects/oChest/oChest.yy index 60d2703..19fedfc 100644 --- a/objects/oChest/oChest.yy +++ b/objects/oChest/oChest.yy @@ -22,6 +22,7 @@ "physicsShapePoints": [], "eventList": [ {"isDnD":false,"eventNum":0,"eventType":4,"collisionObjectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"parent":{"name":"oChest","path":"objects/oChest/oChest.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"parent":{"name":"oChest","path":"objects/oChest/oChest.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, ], "properties": [], "overriddenProperties": [], diff --git a/objects/oGame/Create_0.gml b/objects/oGame/Create_0.gml index 5091bf0..2fe0595 100644 --- a/objects/oGame/Create_0.gml +++ b/objects/oGame/Create_0.gml @@ -18,7 +18,9 @@ for (i = 0; i < 4; i++) { for(j = 0; j < 4; j++) { + coffre[i][j] = 0; tableau[i, j] = irandom(10); + if (tableau[i, j] = 9) coffre[i,j] = 1; } } diff --git a/objects/oGame/Step_0.gml b/objects/oGame/Step_0.gml index 2c22782..cd02235 100644 --- a/objects/oGame/Step_0.gml +++ b/objects/oGame/Step_0.gml @@ -48,3 +48,7 @@ with (oPlayer) { room_goto(rWin); } } + +// ouverture des portes + +if (room != rOver and room != rWin and !instance_exists(oMonsterMelee)) oTransition.image_index = 1; diff --git a/objects/oTransition/Collision_oPlayer.gml b/objects/oTransition/Collision_oPlayer.gml index d78cd5e..ca6bcb4 100644 --- a/objects/oTransition/Collision_oPlayer.gml +++ b/objects/oTransition/Collision_oPlayer.gml @@ -1 +1 @@ -global.transition = next; \ No newline at end of file +if (image_index = 1) global.transition = next; \ No newline at end of file