Minor issue with subtraction in book
KernelPanic0 opened this issue · 2 comments
KernelPanic0 commented
The book states:
"If we attempt to use the enemy's position, our calculations will be incorrect. Instead, we need to determine these values by subtracting the enemy's position from the player's position. This will give us values that will act as if the player is always at (0, 0), or the absolute position (abspos) between our player and the enemy:"
And the code that follows is:
float abspos_x = enemy->x - player->x;
float abspos_y = enemy->y - player->y;
The paragraph needs to be corrected to "... by subtracting the players position from the enemy's position ..."
attilathedud commented
Good callout, thanks!
attilathedud commented
Updated on the site.