deplacement monstre
This commit is contained in:
parent
bd7a1411f9
commit
84e62290c1
3 changed files with 41 additions and 2 deletions
13
objects/oMonster/Create_0.gml
Normal file
13
objects/oMonster/Create_0.gml
Normal 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;
|
||||||
|
}
|
19
objects/oMonster/Step_0.gml
Normal file
19
objects/oMonster/Step_0.gml
Normal 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;
|
||||||
|
}
|
|
@ -17,8 +17,15 @@
|
||||||
"physicsStartAwake": true,
|
"physicsStartAwake": true,
|
||||||
"physicsKinematic": false,
|
"physicsKinematic": false,
|
||||||
"physicsShapePoints": [],
|
"physicsShapePoints": [],
|
||||||
"eventList": [],
|
"eventList": [
|
||||||
"properties": [],
|
{"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": [],
|
"overriddenProperties": [],
|
||||||
"parent": {
|
"parent": {
|
||||||
"name": "Entity",
|
"name": "Entity",
|
||||||
|
|
Reference in a new issue