Browse Source

Patch Son et modification hit (knockback doit etre ajouté manuellement)

dev
rick 1 year ago
parent
commit
1a50760b59
  1. 3
      Surprise Dungeon.yyp
  2. 2
      objects/oFire/Collision_oPlayer.gml
  3. 1
      objects/oFire/Create_0.gml
  4. 1
      objects/oFire/oFire.yy
  5. 18
      objects/oPlayer/Collision_oMonster.gml
  6. 3
      objects/oPlayer/KeyPress_74.gml
  7. 2
      objects/oTrou/Collision_oPlayer.gml
  8. 1
      objects/oTrou/Create_0.gml
  9. 1
      objects/oTrou/oTrou.yy
  10. 5
      scripts/Script1/Script1.gml

3
Surprise Dungeon.yyp

@ -8,15 +8,18 @@ @@ -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,},

2
objects/oFire/Collision_oPlayer.gml

@ -1 +1 @@ @@ -1 +1 @@
hit(self, other, 2);
hit(self, other);

1
objects/oFire/Create_0.gml

@ -0,0 +1 @@ @@ -0,0 +1 @@
attack = 2;

1
objects/oFire/oFire.yy

@ -22,6 +22,7 @@ @@ -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": [],

18
objects/oPlayer/Collision_oMonster.gml

@ -1,20 +1,6 @@ @@ -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;
}*/
knockBack(other, self);

3
objects/oPlayer/KeyPress_74.gml

@ -26,6 +26,7 @@ switch (indexImageInfo) { @@ -26,6 +26,7 @@ switch (indexImageInfo) {
}
if (inst != noone) {
hit(self, inst, attack);
hit(self, inst);
knockBack(self, inst);
inst.touche = 30;
}

2
objects/oTrou/Collision_oPlayer.gml

@ -1,3 +1,3 @@ @@ -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])));

1
objects/oTrou/Create_0.gml

@ -0,0 +1 @@ @@ -0,0 +1 @@
attack = 10;

1
objects/oTrou/oTrou.yy

@ -22,6 +22,7 @@ @@ -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": [],

5
scripts/Script1/Script1.gml

@ -27,13 +27,12 @@ function knockBack(obj, objRepousse) { @@ -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);
}
/*

Loading…
Cancel
Save