Classy Class - Movement

Hi,

I am following the steps shown in the lesson Movement in the Classy Class section. In the lesson, we are told to use the code below to stop at the edge of the map.

        if (Vector2Length(direction) != 0.0)
        {
            // set mapPos = mapPos - direction
            mapPos = Vector2Subtract(mapPos, Vector2Normalize(direction));
        }

However, when I use the above code, the direction is still going beyond the edge of the map and shows the white background of the screen. What am I doing wrong?

Classy Clash

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

Privacy & Terms