From ef3cd366ac6b2bfee85fa22653b2be9cfd09a138 Mon Sep 17 00:00:00 2001 From: sOlaris38 Date: Sun, 6 Dec 2020 19:00:27 +0100 Subject: [PATCH] rWin --- Surprise Dungeon.yyp | 2 + objects/oGame/Create_0.gml | 19 +++++---- objects/oGame/Draw_64.gml | 9 ++++- objects/oGame/Step_0.gml | 8 ++++ objects/oMaudit/Collision_oPlayer.gml | 1 + rooms/rWin/rOver.yy | 56 +++++++++++++++++++++++++++ rooms/rWin/rWin.yy | 56 +++++++++++++++++++++++++++ sprites/sTrou/sTrou.yy | 2 +- 8 files changed, 142 insertions(+), 11 deletions(-) create mode 100644 objects/oMaudit/Collision_oPlayer.gml create mode 100644 rooms/rWin/rOver.yy create mode 100644 rooms/rWin/rWin.yy diff --git a/Surprise Dungeon.yyp b/Surprise Dungeon.yyp index 21edc6f..3f9effe 100644 --- a/Surprise Dungeon.yyp +++ b/Surprise Dungeon.yyp @@ -19,6 +19,7 @@ {"id":{"name":"sPlayerRun","path":"sprites/sPlayerRun/sPlayerRun.yy",},"order":1,}, {"id":{"name":"oMonsterMelee","path":"objects/oMonsterMelee/oMonsterMelee.yy",},"order":2,}, {"id":{"name":"sStone","path":"sprites/sStone/sStone.yy",},"order":5,}, + {"id":{"name":"rWin","path":"rooms/rWin/rWin.yy",},"order":15,}, {"id":{"name":"oMaudit","path":"objects/oMaudit/oMaudit.yy",},"order":1,}, {"id":{"name":"oOver","path":"objects/oOver/oOver.yy",},"order":4,}, {"id":{"name":"r4","path":"rooms/r4/r4.yy",},"order":5,}, @@ -72,6 +73,7 @@ {"roomId":{"name":"r10","path":"rooms/r10/r10.yy",},}, {"roomId":{"name":"rOver","path":"rooms/rOver/rOver.yy",},}, {"roomId":{"name":"r11","path":"rooms/r11/r11.yy",},}, + {"roomId":{"name":"rWin","path":"rooms/rWin/rWin.yy",},}, ], "Folders": [ {"folderPath":"folders/Sprites.yy","order":0,"resourceVersion":"1.0","name":"Sprites","tags":[],"resourceType":"GMFolder",}, diff --git a/objects/oGame/Create_0.gml b/objects/oGame/Create_0.gml index 7ae2b40..5091bf0 100644 --- a/objects/oGame/Create_0.gml +++ b/objects/oGame/Create_0.gml @@ -3,14 +3,6 @@ randomize(); -for (i = 0; i < 4; i++) -{ - for(j = 0; j < 4; j++) - { - tableau[i, j] = irandom(10); - - } -} global.difficulty = 1; global.minutes = 2; @@ -22,6 +14,15 @@ global.spawn = -1; global.perdu = false; +for (i = 0; i < 4; i++) +{ + for(j = 0; j < 4; j++) + { + tableau[i, j] = irandom(10); + + } +} + posXfin = irandom(3); posYfin = irandom(3); tableau[posXfin, posYfin] = 11; @@ -36,3 +37,5 @@ while(posXfin = posX and posYfin = posY) { room_goto(asset_get_index("r" + string(tableau[posX, posY]))); + + diff --git a/objects/oGame/Draw_64.gml b/objects/oGame/Draw_64.gml index 0363397..527fc66 100644 --- a/objects/oGame/Draw_64.gml +++ b/objects/oGame/Draw_64.gml @@ -1,4 +1,4 @@ -if (room != rOver) { +if (room != rOver and room != rWin) { draw_rectangle_color(1280,0,display_get_gui_width(),96,c_black,c_black,c_black,c_black,false); draw_text(1312,72,"map"); draw_rectangle_color(0,0,display_get_gui_width() - 1280,96,c_black,c_black,c_black,c_black,false); @@ -35,8 +35,13 @@ if (room != rOver) { draw_text(800,16,room_get_name(room)); } -else { +else if (room = rOver) { draw_text_transformed(room_width / 2, room_height / 2, "GAME OVER!", 2, 2, image_angle); draw_text_transformed(room_width / 2, room_height / 2 + 128, "PRESS R TO RESTART", 2, 2, image_angle); } +else { + draw_text_transformed(room_width / 2, room_height / 2, "VICTORY!", 2, 2, image_angle); + draw_text_transformed(room_width / 2, room_height / 2 + 128, "PRESS R TO RESTART", 2, 2, image_angle); +} + diff --git a/objects/oGame/Step_0.gml b/objects/oGame/Step_0.gml index 1ee4562..9eff728 100644 --- a/objects/oGame/Step_0.gml +++ b/objects/oGame/Step_0.gml @@ -39,3 +39,11 @@ if (global.perdu) { room_goto(rOver); global.perdu = false; } + +// contact avec objet maudit + +with (oPlayer) { + if place_meeting(x,y,oMaudit) { + + } +} diff --git a/objects/oMaudit/Collision_oPlayer.gml b/objects/oMaudit/Collision_oPlayer.gml new file mode 100644 index 0000000..b796fd6 --- /dev/null +++ b/objects/oMaudit/Collision_oPlayer.gml @@ -0,0 +1 @@ +global.difficulty ++; \ No newline at end of file diff --git a/rooms/rWin/rOver.yy b/rooms/rWin/rOver.yy new file mode 100644 index 0000000..b245713 --- /dev/null +++ b/rooms/rWin/rOver.yy @@ -0,0 +1,56 @@ +{ + "isDnd": false, + "volume": 1.0, + "parentRoom": null, + "views": [ + {"inherit":false,"visible":true,"xview":0,"yview":0,"wview":432,"hview":240,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + ], + "layers": [ + {"instances":[ + {"properties":[],"isDnd":false,"objectId":{"name":"oOver","path":"objects/oOver/oOver.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":208.0,"y":80.0,"resourceVersion":"1.0","name":"inst_39EB715D","tags":[],"resourceType":"GMRInstance",}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":16,"gridY":16,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, + {"spriteId":null,"colour":4289967027,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Background","tags":[],"resourceType":"GMRBackgroundLayer",}, + ], + "inheritLayers": false, + "creationCodeFile": "", + "inheritCode": false, + "instanceCreationOrder": [ + {"name":"inst_39EB715D","path":"rooms/rOver/rOver.yy",}, + ], + "inheritCreationOrder": false, + "sequenceId": null, + "roomSettings": { + "inheritRoomSettings": false, + "Width": 432, + "Height": 240, + "persistent": false, + }, + "viewSettings": { + "inheritViewSettings": false, + "enableViews": true, + "clearViewBackground": false, + "clearDisplayBuffer": true, + }, + "physicsSettings": { + "inheritPhysicsSettings": false, + "PhysicsWorld": false, + "PhysicsWorldGravityX": 0.0, + "PhysicsWorldGravityY": 10.0, + "PhysicsWorldPixToMetres": 0.1, + }, + "parent": { + "name": "rooms", + "path": "folders/Rooms/rooms.yy", + }, + "resourceVersion": "1.0", + "name": "rOver", + "tags": [], + "resourceType": "GMRoom", +} \ No newline at end of file diff --git a/rooms/rWin/rWin.yy b/rooms/rWin/rWin.yy new file mode 100644 index 0000000..0380490 --- /dev/null +++ b/rooms/rWin/rWin.yy @@ -0,0 +1,56 @@ +{ + "isDnd": false, + "volume": 1.0, + "parentRoom": null, + "views": [ + {"inherit":false,"visible":true,"xview":0,"yview":0,"wview":432,"hview":240,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + {"inherit":false,"visible":false,"xview":0,"yview":0,"wview":1366,"hview":768,"xport":0,"yport":0,"wport":1366,"hport":768,"hborder":32,"vborder":32,"hspeed":-1,"vspeed":-1,"objectId":null,}, + ], + "layers": [ + {"instances":[ + {"properties":[],"isDnd":false,"objectId":{"name":"oOver","path":"objects/oOver/oOver.yy",},"inheritCode":false,"hasCreationCode":false,"colour":4294967295,"rotation":0.0,"scaleX":1.0,"scaleY":1.0,"imageIndex":0,"imageSpeed":1.0,"inheritedItemId":null,"frozen":false,"ignore":false,"inheritItemSettings":false,"x":208.0,"y":80.0,"resourceVersion":"1.0","name":"inst_39EB715D","tags":[],"resourceType":"GMRInstance",}, + ],"visible":true,"depth":0,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":16,"gridY":16,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Instances","tags":[],"resourceType":"GMRInstanceLayer",}, + {"spriteId":null,"colour":4289967027,"x":0,"y":0,"htiled":false,"vtiled":false,"hspeed":0.0,"vspeed":0.0,"stretch":false,"animationFPS":15.0,"animationSpeedType":0,"userdefinedAnimFPS":false,"visible":true,"depth":100,"userdefinedDepth":false,"inheritLayerDepth":false,"inheritLayerSettings":false,"gridX":32,"gridY":32,"layers":[],"hierarchyFrozen":false,"resourceVersion":"1.0","name":"Background","tags":[],"resourceType":"GMRBackgroundLayer",}, + ], + "inheritLayers": false, + "creationCodeFile": "", + "inheritCode": false, + "instanceCreationOrder": [ + {"name":"inst_39EB715D","path":"rooms/rWin/rWin.yy",}, + ], + "inheritCreationOrder": false, + "sequenceId": null, + "roomSettings": { + "inheritRoomSettings": false, + "Width": 432, + "Height": 240, + "persistent": false, + }, + "viewSettings": { + "inheritViewSettings": false, + "enableViews": true, + "clearViewBackground": false, + "clearDisplayBuffer": true, + }, + "physicsSettings": { + "inheritPhysicsSettings": false, + "PhysicsWorld": false, + "PhysicsWorldGravityX": 0.0, + "PhysicsWorldGravityY": 10.0, + "PhysicsWorldPixToMetres": 0.1, + }, + "parent": { + "name": "rooms", + "path": "folders/Rooms/rooms.yy", + }, + "resourceVersion": "1.0", + "name": "rWin", + "tags": [], + "resourceType": "GMRoom", +} \ No newline at end of file diff --git a/sprites/sTrou/sTrou.yy b/sprites/sTrou/sTrou.yy index 20c5a12..404b45c 100644 --- a/sprites/sTrou/sTrou.yy +++ b/sprites/sTrou/sTrou.yy @@ -38,7 +38,7 @@ "spriteId": {"name":"sTrou","path":"sprites/sTrou/sTrou.yy",}, "timeUnits": 1, "playback": 1, - "playbackSpeed": 30.0, + "playbackSpeed": 0.0, "playbackSpeedType": 0, "autoRecord": true, "volume": 1.0,