diff --git a/Surprise Dungeon.yyp b/Surprise Dungeon.yyp index e5ba91c..7af69d1 100644 --- a/Surprise Dungeon.yyp +++ b/Surprise Dungeon.yyp @@ -8,15 +8,18 @@ {"id":{"name":"r7","path":"rooms/r7/r7.yy",},"order":8,}, {"id":{"name":"sMaudit","path":"sprites/sMaudit/sMaudit.yy",},"order":14,}, {"id":{"name":"sTrouDetect","path":"sprites/sTrouDetect/sTrouDetect.yy",},"order":2,}, + {"id":{"name":"snHit","path":"sounds/snHit/snHit.yy",},"order":1,}, {"id":{"name":"r0","path":"rooms/r0/r0.yy",},"order":1,}, {"id":{"name":"rWin","path":"rooms/rWin/rWin.yy",},"order":14,}, {"id":{"name":"oGame","path":"objects/oGame/oGame.yy",},"order":2,}, {"id":{"name":"TileSet1","path":"tilesets/TileSet1/TileSet1.yy",},"order":0,}, + {"id":{"name":"snAttack","path":"sounds/snAttack/snAttack.yy",},"order":2,}, {"id":{"name":"oChest","path":"objects/oChest/oChest.yy",},"order":0,}, {"id":{"name":"sWalls","path":"sprites/sWalls/sWalls.yy",},"order":5,}, {"id":{"name":"r11","path":"rooms/r11/r11.yy",},"order":15,}, {"id":{"name":"rOver","path":"rooms/rOver/rOver.yy",},"order":13,}, {"id":{"name":"r8","path":"rooms/r8/r8.yy",},"order":9,}, + {"id":{"name":"snFond","path":"sounds/snFond/snFond.yy",},"order":0,}, {"id":{"name":"oTransition","path":"objects/oTransition/oTransition.yy",},"order":0,}, {"id":{"name":"rType","path":"rooms/rType/rType.yy",},"order":0,}, {"id":{"name":"sPlayerRun","path":"sprites/sPlayerRun/sPlayerRun.yy",},"order":1,}, diff --git a/objects/oFire/Collision_oPlayer.gml b/objects/oFire/Collision_oPlayer.gml index 61ff146..f3e4af4 100644 --- a/objects/oFire/Collision_oPlayer.gml +++ b/objects/oFire/Collision_oPlayer.gml @@ -1 +1 @@ -hit(self, other, 2); \ No newline at end of file +hit(self, other); \ No newline at end of file diff --git a/objects/oFire/Create_0.gml b/objects/oFire/Create_0.gml new file mode 100644 index 0000000..e5cb28b --- /dev/null +++ b/objects/oFire/Create_0.gml @@ -0,0 +1 @@ +attack = 2; \ No newline at end of file diff --git a/objects/oFire/oFire.yy b/objects/oFire/oFire.yy index 8a05866..43a7d32 100644 --- a/objects/oFire/oFire.yy +++ b/objects/oFire/oFire.yy @@ -22,6 +22,7 @@ "physicsShapePoints": [], "eventList": [ {"isDnD":false,"eventNum":0,"eventType":4,"collisionObjectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"parent":{"name":"oFire","path":"objects/oFire/oFire.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"parent":{"name":"oFire","path":"objects/oFire/oFire.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, ], "properties": [], "overriddenProperties": [], diff --git a/objects/oPlayer/Collision_oMonster.gml b/objects/oPlayer/Collision_oMonster.gml index 3da6240..f30fc4b 100644 --- a/objects/oPlayer/Collision_oMonster.gml +++ b/objects/oPlayer/Collision_oMonster.gml @@ -1,20 +1,6 @@ if (inv == 0) { audio_play_sound(snHit,1,false); - hit(other, self, other.attack); + hit(other, self); inv = 30; -} else { - knockBack(other, self); } - -// pushback -/* -knockback = 10; -if (other.x > x && !place_meeting(x-knockback-1, y, oWall)) { - x -= knockback; -} else if (other.x < x && !place_meeting(x+knockback+1, y, oWall)) { - x += knockback; -} else if (other.y > y && !place_meeting(x, y-knockback-1, oWall)) { - y -= knockback; -} else if (other.y < y && !place_meeting(x, y+knockback+1, oWall)) { - y += knockback; -}*/ \ No newline at end of file +knockBack(other, self); \ No newline at end of file diff --git a/objects/oPlayer/KeyPress_74.gml b/objects/oPlayer/KeyPress_74.gml index 18070d1..d045398 100644 --- a/objects/oPlayer/KeyPress_74.gml +++ b/objects/oPlayer/KeyPress_74.gml @@ -26,6 +26,7 @@ switch (indexImageInfo) { } if (inst != noone) { - hit(self, inst, attack); + hit(self, inst); + knockBack(self, inst); inst.touche = 30; } \ No newline at end of file diff --git a/objects/oTrou/Collision_oPlayer.gml b/objects/oTrou/Collision_oPlayer.gml index f66e049..c850c55 100644 --- a/objects/oTrou/Collision_oPlayer.gml +++ b/objects/oTrou/Collision_oPlayer.gml @@ -1,3 +1,3 @@ -hit (self, other, 10); +hit (self, other); audio_play_sound(snHit,1,false); room_goto(asset_get_index("r" + string(oGame.tableau[oGame.posX, oGame.posY]))); \ No newline at end of file diff --git a/objects/oTrou/Create_0.gml b/objects/oTrou/Create_0.gml new file mode 100644 index 0000000..2423629 --- /dev/null +++ b/objects/oTrou/Create_0.gml @@ -0,0 +1 @@ +attack = 10; \ No newline at end of file diff --git a/objects/oTrou/oTrou.yy b/objects/oTrou/oTrou.yy index 8d39ee1..f93daee 100644 --- a/objects/oTrou/oTrou.yy +++ b/objects/oTrou/oTrou.yy @@ -22,6 +22,7 @@ "physicsShapePoints": [], "eventList": [ {"isDnD":false,"eventNum":0,"eventType":4,"collisionObjectId":{"name":"oPlayer","path":"objects/oPlayer/oPlayer.yy",},"parent":{"name":"oTrou","path":"objects/oTrou/oTrou.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, + {"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"parent":{"name":"oTrou","path":"objects/oTrou/oTrou.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",}, ], "properties": [], "overriddenProperties": [], diff --git a/scripts/Script1/Script1.gml b/scripts/Script1/Script1.gml index 1b72b2a..6cf2dd9 100644 --- a/scripts/Script1/Script1.gml +++ b/scripts/Script1/Script1.gml @@ -27,13 +27,12 @@ function knockBack(obj, objRepousse) { @param {objAttaque} objet qui perd des pv @param {degats} dégâts infligés (permet de gérer les attaques cac ou distance pour le joueur */ -function hit(objAttaquant, objAttaque, degats) { - objAttaque.pv -= degats; +function hit(objAttaquant, objAttaque) { + objAttaque.pv -= objAttaquant.attack; if (objAttaque.pv <= 0) { if (objAttaque.object_index = oPlayer) global.perdu = true; else instance_destroy(objAttaque); } - else knockBack(objAttaquant, objAttaque); } /*