Skip to content

Commit

Permalink
unified all the sprites' speeds with a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
benoitdekeyn committed Dec 21, 2023
1 parent 7f5224d commit f90d7d8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endstruc
%define FRAMES_COUNTER_GHOSTS_ANIMATION 6
%define FRAMES_COUNTER_POWER_PELLET_ANIMATION 6

%define SPRITE_SPEED_PIXELS 1
%define SPRITE_SPEED_PIXELS 2

%define NUMBER_OF_PELLETS 260

Expand Down
8 changes: 4 additions & 4 deletions src/keyboard.asm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ section .text
cmp byte[jumpNoLeft], 1
je .NoLeft

mov word[strcPacMan + velocityX], -2
mov word[strcPacMan + velocityX], -1*SPRITE_SPEED_PIXELS
mov word[strcPacMan + velocityY], 0
mov word[strcPacMan + direction], LEFT_DIRECTION
Expand Down Expand Up @@ -100,7 +100,7 @@ section .text
cmp byte[jumpNoRight], 1
je .NoRight

mov word[strcPacMan + velocityX], 2
mov word[strcPacMan + velocityX], 1*SPRITE_SPEED_PIXELS
mov word[strcPacMan + velocityY], 0
mov word[strcPacMan + direction], RIGHT_DIRECTION

Expand Down Expand Up @@ -142,7 +142,7 @@ section .text
neg dx

mov word[strcPacMan + velocityX], 0
mov word[strcPacMan + velocityY], -2
mov word[strcPacMan + velocityY], -1*SPRITE_SPEED_PIXELS
mov word[strcPacMan + direction], UP_DIRECTION

call changePacManPosition
Expand Down Expand Up @@ -180,7 +180,7 @@ section .text
cmp byte[jumpNoDown], 1
je .NoDown
mov word[strcPacMan + velocityX], 0
mov word[strcPacMan + velocityY], 2
mov word[strcPacMan + velocityY], 1*SPRITE_SPEED_PIXELS
mov word[strcPacMan + direction], DOWN_DIRECTION

call changePacManPosition
Expand Down

0 comments on commit f90d7d8

Please sign in to comment.