diff --git a/src/defs.h b/src/defs.h index d448847..a917f67 100644 --- a/src/defs.h +++ b/src/defs.h @@ -313,5 +313,5 @@ static const signed char rate2reload[6] = {15, 15, 13, 11, 9, 7}; const int screenWidth = 800; const int screenHeight = 600; - -const int viewBorder = 100; +const int xViewBorder = 100; +const int yViewBorder = 100; diff --git a/src/player.cpp b/src/player.cpp index e56b98a..2d5e852 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -193,25 +193,25 @@ void doPlayer() if (engine.done == 0) { - if (player.x < viewBorder) + if (player.x < xViewBorder) { - engine.smx += viewBorder - player.x; - player.x = viewBorder; + engine.smx += xViewBorder - player.x; + player.x = xViewBorder; } - else if (player.x > screen->w - viewBorder) + else if (player.x > screen->w - xViewBorder) { - engine.smx += (screen->w - viewBorder) - player.x; - player.x = screen->w - viewBorder; + engine.smx += (screen->w - xViewBorder) - player.x; + player.x = screen->w - xViewBorder; } - if (player.y < viewBorder) + if (player.y < yViewBorder) { - engine.smy += viewBorder - player.y; - player.y = viewBorder; + engine.smy += yViewBorder - player.y; + player.y = yViewBorder; } - else if (player.y > screen->h - viewBorder) + else if (player.y > screen->h - yViewBorder) { - engine.smy += (screen->h - viewBorder) - player.y; - player.y = screen->h - viewBorder; + engine.smy += (screen->h - yViewBorder) - player.y; + player.y = screen->h - yViewBorder; } }