4
0
Fork 0
This repository has been archived on 2023-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
surprise_dungeon/objects/oGame/Step_0.gml

55 lines
989 B
Text
Raw Normal View History

2020-12-06 14:02:23 +01:00
// chrono
2020-12-06 17:05:26 +01:00
if (!global.perdu) {
2020-12-06 14:02:23 +01:00
global.secondes -= 1/room_speed;
if (global.secondes <= 0) {
global.minutes --;
global.secondes = 20;
2020-12-06 17:05:26 +01:00
if (global.minutes < 0) {
global.perdu = true;
}
2020-12-06 14:02:23 +01:00
}
2020-12-06 16:25:20 +01:00
}
// transition
if (global.transition != -1) {
switch(global.transition) {
case 0 :
if (posY = 0) posY = 3;
else posY --; break;
case 1 :
if (posX = 3) posX = 0;
else posX ++; break;
case 2 :
if (posY = 3) posY = 0;
else posY ++; break;
case 3 :
if (posX = 0) posX = 3;
else posX --; break;
}
2020-12-06 17:28:28 +01:00
global.spawn = global.transition;
2020-12-06 16:25:20 +01:00
global.transition = -1;
room_goto(asset_get_index("r" + string(tableau[posX, posY])));
}
2020-12-06 17:05:26 +01:00
// défaite
if (global.perdu) {
room_goto(rOver);
global.perdu = false;
}
2020-12-06 19:00:27 +01:00
// contact avec objet maudit
with (oPlayer) {
if place_meeting(x,y,oMaudit) {
2020-12-06 19:08:59 +01:00
global.minutes = 5;
room_goto(rWin);
2020-12-06 19:00:27 +01:00
}
}
2020-12-06 19:53:51 +01:00
// ouverture des portes
if (room != rOver and room != rWin and !instance_exists(oMonsterMelee)) oTransition.image_index = 1;