game works perfectly in standard screensize but not in fullscreen

51 views Asked by At

So a friend and I are making a horizontal scroller game. There are mice hidden throughout the screen and because it's a horizontal scroller game you can also scroll to the left and right and see more mice.

We originally made this game in de default xna screensize (800 x 480). We're now at a point where we want our game to be fullscreen. Our point of the game is to click on the mice and get a higher score, etc...

Now before we made our game fullscreen we could click on the mice and our score would add up. After we've made it fullscreen we can't click on the mice anymore. Well, we can still click on them, but instead of adding points to our score nothing happens.

We're using bounding boxes on the mice, and whenever the X & Y position of our computermouse is withing one of those boundingboxes and you will click with your computermouse at the moment that your computermouse is inside a mouse boundingbox then you're supposed to get points adding up to your score. This is the code for the boundingbox on every mouse.

public Rectangle getBoundingBox()
    {
        return new Rectangle(
            (int)_position.X,
            (int)_position.Y,
            _texture.Width,
            _texture.Height
            );
    }

We gave all our mice a position by the next code:

        _position = _scrollerBackground.GetPosition() + _offsetFromBackground;

The next piece of code is how we get the position of our mouse and what it should do when the position of the mouse is within one of our mice(_number0). When the mouseposition is within the boundingbox from the mouse and when the computermouse clicks at that moment then input = 0;

public void UpdateMouse()
    {
        mouse = Mouse.GetState();
        mousePosition.X = mouse.X;
        mousePosition.Y = mouse.Y;
    }
public void OnMouseOver()
{
    if (_number0.getBoundingBox().Contains(mousePosition))
    {
        if (mouse.LeftButton == ButtonState.Pressed && oldMouseState.LeftButton == ButtonState.Released)
        {
            input += "0";
        }
    }

This is how it worked before we made our game fullscreen, but now that doesn't work anymore. This is the code we used to make our game fullscreen:

        graphics.IsFullScreen = true;

Does anyone have any similar experiences or maybe knows how to fix this?

0

There are 0 answers