hi ich hoffe Ihr könnt mir helfen, ich sitz schon eine weile dran kann den Fehler aber einfach nicht finden.
Dies ist in der Step von meinem Player, um zu schlagen und ändern des sprites nach dem 5. bild. (in der creat die ganzen variablen)
Alles anzeigen
Komisch ist nur das es nur manchmal klappt das er die "punch" auf 0 zurücksetzt.
Manchmal klappt es nach dem die Animation 2-3 mal durchgelaufen ist.
Manchmal aber koplett garnicht mehr und die Animation läuft ohne ende in einer Schleife.
Dies ist in der Step von meinem Player, um zu schlagen und ändern des sprites nach dem 5. bild. (in der creat die ganzen variablen)
GML-Quellcode
- //Schlagen//
- if keyboard_check_released (ord("A"))
- {
- punch = 1;
- run = 0
- }
- //Animation Change//
- //Stehen//
- if right = 1 and run = 0 and jump = 0 and punch = 0 {sprite_index = spr_playerRight;image_speed = 0.3}
- if right = 0 and run = 0 and jump = 0 and punch = 0 {sprite_index = spr_playerLeft;image_speed = 0.3}
- //Laufen//
- if right = 1 and run = 1 and jump = 0 and punch = 0 {sprite_index = spr_playerWalkRight;image_speed = 0.3}
- if right = 0 and run = 1 and jump = 0 and punch = 0 {sprite_index = spr_playerWalkLeft;image_speed = 0.3}
- //Laufen&Springen//
- if right = 1 and run = 1 and jump = 1 and punch = 0 {sprite_index = spr_playerJumpRight;image_speed = 0.4}
- if right = 0 and run = 1 and jump = 1 and punch = 0 {sprite_index = spr_playerJumpLeft;image_speed = 0.4}
- //Springen//
- if right = 1 and run = 0 and jump = 1 and punch = 0 {sprite_index = spr_playerJumpRight;image_speed = 0.4}
- if right = 0 and run = 0 and jump = 1 and punch = 0 {sprite_index = spr_playerJumpLeft;image_speed = 0.4}
- //Schlagen//
- if right = 1 and run = 0 and jump = 0 and punch = 1 {sprite_index = spr_playerPunchRight;image_speed = 0.4}
- if right = 1 and image_index = 4
- {
- punch = 0;
- sprite_index = spr_playerRight
- }
- if right = 0 and run = 0 and jump = 0 and punch = 1 {sprite_index = spr_playerPunchLeft;image_speed = 0.4}
- if right = 0 and image_index = 4
- {
- punch = 0;
- sprite_index = spr_playerLeft
- }
Komisch ist nur das es nur manchmal klappt das er die "punch" auf 0 zurücksetzt.
Manchmal klappt es nach dem die Animation 2-3 mal durchgelaufen ist.
Manchmal aber koplett garnicht mehr und die Animation läuft ohne ende in einer Schleife.