Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8960173
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:36:46+00:00 2026-06-15T15:36:46+00:00

I am developing a Arkanoid (Breakout) game on Windows Phone 7. I added a

  • 0

I am developing a Arkanoid (Breakout) game on Windows Phone 7.

I added a handler to the base of my GamePage constructor:

public GamePage()
    {
        InitializeComponent();

        // Get the content manager from the application
        contentManager = (Application.Current as App).Content;

        // Create a timer for this page
        timer = new GameTimer();
        timer.UpdateInterval = TimeSpan.FromTicks(333333);
        timer.Update += OnUpdate;
        timer.Draw += OnDraw;

        base.OnMouseMove += new MouseEventHandler(GamePage_MouseMove);

        init();
    }

And this is the handling function:

private void GamePage_MouseMove(object sender, MouseEventArgs e)
    {
        //this changes the ball coordinates based on yVel and xVel properties of the ball
        ball.moveBall();
    }

The GamePage_MouseMove function is never called and I dont know why. The ball is not moving.

Another issue is the onUpdate function:

private void OnUpdate(object sender, GameTimerEventArgs e)
    {
        //if the ball rectangle intersects with the paddle rectange, change the ball yVel
        if (ball.BallRec.Intersects(paddle.PaddleRec))
            ball.YVel = -1;
        ball.moveBall();
    }

Even if the ball intersects with the paddle it continues to move to the original direction and doesnt “bounce”.

Please help.

Update

After a small modification the onUpdate function is now:

private void OnUpdate(object sender, GameTimerEventArgs e)
    {
        MouseState ms = Mouse.GetState();
        if(ms.LeftButton == ButtonState.Pressed)
            paddle.movePaddle((int)ms.X);
    }

But the paddle is not moving.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T15:36:47+00:00Added an answer on June 15, 2026 at 3:36 pm

    You should consider inspecting the MouseState structure during your Update rather than trying to capture mouse events.

    Something along the lines of:

    protected override void Update(GameTime gameTime)
    {
      // snip...
    
      MouseState mouseState = Mouse.GetState();
    
      //Respond to the position of the mouse.
      //For example, change the position of a sprite 
      //based on mouseState.X or mouseState.Y
    
      //Respond to the left mouse button being pressed
      if (mouseState.LeftButton == ButtonState.Pressed)
      {
        //The left mouse button is pressed. 
      }
    
      base.Update(gameTime);
    }
    

    There is a great example of how to use the mouse as an input device in the documentation: http://msdn.microsoft.com/en-us/library/bb197572.aspx

    In addition, for the phone, remember that you have true touch capabilities as well as the accelerometer available to you. You can learn about all the input options here: http://msdn.microsoft.com/en-us/library/bb203899.aspx

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

iam developing one application.In that i need to get the music files from the
Developing a website and just trying to get back into the swing of (clever)
Developing a game with AndEngine GLES2 I am having an issue trying to change
Developing a simple game for the iPhone, what gives a better performance? Using a
Developing an interface generic I wished to declare a constructor in an interface but
Developing search utility to search a file entire computer system, works fine on windows
Developing an application using SWT to work in both Linux and Windows. I created
developing for Android phone(ver 1.5) I would like to know if there is an
im developing a metro app for windows 8 and I have big difficulties to
When developing and deploying native Windows applications, I often need to install a runtime

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.