Help debugging a C# game

closed account (3qX21hU5)
Hey guys, so wasn't sure where to put this since it involves C# programming and XNA and not C++ so I just put it here. I am currently learning C# and reading through a book about game making in XNA. Now I have this game where the goal is to connect pipes on the board so water can flow from one side to the other. Now that works in the game but here is the problem.

I tried to add a text effect where when you score it shows how much you scored then the texts zooms off the screen. Now after I added this effect I ran into a bug that has been stumping me for a day now. Right after the score zooms off the screen when you click the mouse it thinks that it is about 2 inches to the right of where it should be. I'm probably not explaining it very well so I will just include a link to download my source code and you can compile it and run it to see for yourself.

Now this is probably something simple, but for some reason I can't track down the problem (Probably because I'm new to C# and OOP). Any help you guys can provide I would be grateful for, and again this is C# and XNA so you will need them to compile the program.

This link contains all the sources and other files you need. -

Thank in advance guys.
Last edited on
It's difficult to determine where the exact problem is due to how input filtering is done, but I have a feeling that it's not so much an issue with the text as it is a bug with how the pipes slide down after you gain points. Was that working fine before you added the text?
closed account (3qX21hU5)
Yes that was currently working before I added the text, also I have tracked down what line is doing it. If I comment out this line

ScoreZooms.Enqueue(new ScoreZoom("+" + DetermineScore(WaterChain.Count).ToString(),
new Color(1.0f, 0.0f, 0.4f)));

in the CheckScoringChain();

The pipes work correctly so that is why I assumed that it was the text effect that was causing the bug. But I'll look into the falling animation and the pipes mechanics a bit closer.
Last edited on
Topic archived. No new replies allowed.