4
0
Fork 0

vitesse du joueur

This commit is contained in:
sOlaris38 2020-12-06 00:28:12 +01:00
parent bacd9b26d1
commit 7a22bb7d44
4 changed files with 12 additions and 10 deletions

View file

@ -11,12 +11,12 @@ deplaceVertical = keyDown - keyUp;
if ((deplaceHorizontal > 0 && !place_meeting(x+1, y, oWall))
|| (deplaceHorizontal < 0 && !place_meeting(x-1, y, oWall))) {
x += deplaceHorizontal;
x += deplaceHorizontal*spd;
}
if ((deplaceVertical > 0 && !place_meeting(x, y+1, oWall))
|| (deplaceVertical < 0 && !place_meeting(x, y-1, oWall))) {
y += deplaceVertical;
y += deplaceVertical*spd;
}
seDeplace = (deplaceHorizontal != 0 or deplaceVertical != 0);
@ -41,7 +41,7 @@ if (seDeplace) {
indexImageInfo = 3;
image_index = compteurFrames % nbFrames + 3*nbFrames;
}
compteurFrames += 0.25;
compteurFrames += 0.25*spd;
} else {
sprite_index = sPlayer;
image_index = indexImageInfo;

View file

@ -32,6 +32,8 @@
{"varType":1,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"deplaceVertical","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"spriteDir","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"8","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"nbFrames","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"0","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"variable_name","tags":[],"resourceType":"GMObjectProperty",},
{"varType":0,"value":"1.2","rangeEnabled":false,"rangeMin":0.0,"rangeMax":10.0,"listItems":[],"multiselect":false,"filters":[],"resourceVersion":"1.0","name":"spd","tags":[],"resourceType":"GMObjectProperty",},
],
"overriddenProperties": [],
"parent": {

View file

@ -7,9 +7,9 @@
"edgeFiltering": false,
"collisionTolerance": 0,
"swfPrecision": 2.525,
"bbox_left": 0,
"bbox_right": 16,
"bbox_top": 1,
"bbox_left": 3,
"bbox_right": 13,
"bbox_top": 11,
"bbox_bottom": 23,
"HTile": false,
"VTile": false,

View file

@ -1,5 +1,5 @@
{
"bboxMode": 0,
"bboxMode": 2,
"collisionKind": 1,
"type": 0,
"origin": 4,
@ -7,9 +7,9 @@
"edgeFiltering": false,
"collisionTolerance": 0,
"swfPrecision": 2.525,
"bbox_left": 0,
"bbox_right": 16,
"bbox_top": 1,
"bbox_left": 3,
"bbox_right": 13,
"bbox_top": 11,
"bbox_bottom": 23,
"HTile": false,
"VTile": false,