4
0
Fork 0
This commit is contained in:
Julien 2020-12-06 20:39:12 +01:00
commit 966f6e37d4
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":"r7","path":"rooms/r7/r7.yy",},"order":8,},
{"id":{"name":"sMaudit","path":"sprites/sMaudit/sMaudit.yy",},"order":14,}, {"id":{"name":"sMaudit","path":"sprites/sMaudit/sMaudit.yy",},"order":14,},
{"id":{"name":"sTrouDetect","path":"sprites/sTrouDetect/sTrouDetect.yy",},"order":2,}, {"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":"r0","path":"rooms/r0/r0.yy",},"order":1,},
{"id":{"name":"rWin","path":"rooms/rWin/rWin.yy",},"order":14,}, {"id":{"name":"rWin","path":"rooms/rWin/rWin.yy",},"order":14,},
{"id":{"name":"oGame","path":"objects/oGame/oGame.yy",},"order":2,}, {"id":{"name":"oGame","path":"objects/oGame/oGame.yy",},"order":2,},
{"id":{"name":"TileSet1","path":"tilesets/TileSet1/TileSet1.yy",},"order":0,}, {"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":"oChest","path":"objects/oChest/oChest.yy",},"order":0,},
{"id":{"name":"sWalls","path":"sprites/sWalls/sWalls.yy",},"order":5,}, {"id":{"name":"sWalls","path":"sprites/sWalls/sWalls.yy",},"order":5,},
{"id":{"name":"r11","path":"rooms/r11/r11.yy",},"order":15,}, {"id":{"name":"r11","path":"rooms/r11/r11.yy",},"order":15,},
{"id":{"name":"rOver","path":"rooms/rOver/rOver.yy",},"order":13,}, {"id":{"name":"rOver","path":"rooms/rOver/rOver.yy",},"order":13,},
{"id":{"name":"r8","path":"rooms/r8/r8.yy",},"order":9,}, {"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":"oTransition","path":"objects/oTransition/oTransition.yy",},"order":0,},
{"id":{"name":"rType","path":"rooms/rType/rType.yy",},"order":0,}, {"id":{"name":"rType","path":"rooms/rType/rType.yy",},"order":0,},
{"id":{"name":"sPlayerRun","path":"sprites/sPlayerRun/sPlayerRun.yy",},"order":1,}, {"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": [], "physicsShapePoints": [],
"eventList": [ "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":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": [], "properties": [],
"overriddenProperties": [], "overriddenProperties": [],

View file

@ -1,20 +1,6 @@
if (inv == 0) { if (inv == 0) {
audio_play_sound(snHit,1,false); audio_play_sound(snHit,1,false);
hit(other, self, other.attack); hit(other, self);
inv = 30; inv = 30;
} else {
knockBack(other, self);
} }
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;
}*/

View file

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

View file

@ -1,3 +1,3 @@
hit (self, other, 10); hit (self, other);
audio_play_sound(snHit,1,false); audio_play_sound(snHit,1,false);
room_goto(asset_get_index("r" + string(oGame.tableau[oGame.posX, oGame.posY]))); 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": [], "physicsShapePoints": [],
"eventList": [ "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":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": [], "properties": [],
"overriddenProperties": [], "overriddenProperties": [],

View file

@ -27,13 +27,12 @@ function knockBack(obj, objRepousse) {
@param {objAttaque} objet qui perd des pv @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 @param {degats} dégâts infligés (permet de gérer les attaques cac ou distance pour le joueur
*/ */
function hit(objAttaquant, objAttaque, degats) { function hit(objAttaquant, objAttaque) {
objAttaque.pv -= degats; objAttaque.pv -= objAttaquant.attack;
if (objAttaque.pv <= 0) { if (objAttaque.pv <= 0) {
if (objAttaque.object_index = oPlayer) global.perdu = true; if (objAttaque.object_index = oPlayer) global.perdu = true;
else instance_destroy(objAttaque); else instance_destroy(objAttaque);
} }
else knockBack(objAttaquant, objAttaque);
} }
/* /*