4
0
Fork 0

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

This commit is contained in:
rick 2020-12-06 20:33:37 +01:00
parent c89557c15a
commit 1a50760b59
10 changed files with 15 additions and 22 deletions

View File

@ -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,},

View File

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

View File

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

View File

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

View File

@ -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);

View File

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

View File

@ -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])));

View File

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

View File

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

View File

@ -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);
}
/*