4
0
Fork 0

deplacement monstre

This commit is contained in:
sOlaris38 2020-12-05 16:33:57 +01:00
parent bd7a1411f9
commit 84e62290c1
3 changed files with 41 additions and 2 deletions

View file

@ -0,0 +1,13 @@
dureeDeplacement = 120;
deplaceHorizontal = 0;
deplaceVertical = 0;
dir = random(3);
switch(dir) {
case 0 : deplacementVertical = 1; break;
case 1 : deplacementHorizontal = 1; break;
case 2 : deplacementVertical = -1; break;
case 3 : deplacementHorizontal = -1; break;
}

View file

@ -0,0 +1,19 @@
// deplacement monstre
if dureeDeplacement != 0 {
x += deplaceHorizontal;
y += deplacementVertical;
dureeDeplacement --;
}
else {
dir = random(3);
switch(dir) {
case 0 : deplacementVertical = 1; break;
case 1 : deplacementHorizontal = 1; break;
case 2 : deplacementVertical = -1; break;
case 3 : deplacementHorizontal = -1; break;
}
dureeDeplacement = 120;
}

View file

@ -17,8 +17,15 @@
"physicsStartAwake": true,
"physicsKinematic": false,
"physicsShapePoints": [],
"eventList": [],
"properties": [],
"eventList": [
{"isDnD":false,"eventNum":0,"eventType":0,"collisionObjectId":null,"parent":{"name":"oMonster","path":"objects/oMonster/oMonster.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
{"isDnD":false,"eventNum":0,"eventType":3,"collisionObjectId":null,"parent":{"name":"oMonster","path":"objects/oMonster/oMonster.yy",},"resourceVersion":"1.0","name":"","tags":[],"resourceType":"GMEvent",},
],
"properties": [
{"varType":0,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"hp","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"speed","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"attack","tags":[],"resourceType":"GMObjectProperty",},
],
"overriddenProperties": [],
"parent": {
"name": "Entity",