Breakout programming problems.
Breakout programming problems.
Breakout programming problems.
Breakout programming problems.
Breakout programming problems.
Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems.
Breakout programming problems. Breakout programming problems.
Breakout programming problems.
Go Back  Xtreme Visual Basic Talk > > > Breakout programming problems.


Reply
 
Thread Tools Display Modes
  #1  
Old 04-25-2010, 03:36 PM
nathan0726 nathan0726 is offline
Newcomer
 
Join Date: Feb 2010
Posts: 2
Default Breakout programming problems.


I have written a decent Breakout type game. But I'm having a couple problems. I start the game with 3 lives, and a score of 0. After you die or destroy all of the bricks, it asks you if you want to play again. If you say yes, it resets the lives and the score. But for some reason, the lives start at 0, and then after you lose one, it says 2. The score starts at 0, and then after hitting a brick, it adds that bricks value to the total previous score of the game before. What am I doing wrong? I can post the code if someone wants to look at it.
Thank you very much.
Reply With Quote
  #2  
Old 04-25-2010, 03:45 PM
FireBot FireBot is offline
Centurion
 
Join Date: Mar 2008
Posts: 100
Default

Seems you use multiple variables for the same things... but don't update them properly.
Reply With Quote
  #3  
Old 04-25-2010, 10:30 PM
ZaCkOX's Avatar
ZaCkOX ZaCkOX is offline
Contributor
 
Join Date: May 2006
Location: CA
Posts: 645
Default When this happens, you break out the "find"

use "find" and search for the variable in question, you can also search for the object in question. Say it's a Label that displays the lifes. If your looking at the label, follow the variable it is equal to.

Example: label1.Caption = x

What is x? Find x, and see where it is changing. Look at all subs and functions that may come in contact with x. You can even do a search for what it equals. Find x = 0 for example, 1, 2 or whatever it is changing too. Look for x =

x being your variable of course, Hope you find the problem
__________________
ZaCkO ... Who is your attitude?
Reply With Quote
  #4  
Old 04-26-2010, 05:09 AM
Qua's Avatar
QuaBreakout programming problems. Qua is offline
Impetuous & volatile

* Expert *
 
Join Date: Apr 2005
Posts: 2,177
Default

From your description I would say that you aren't actually reseting the values. Could you post the code where you a) reset the values b) declare the two variables?
__________________
Reading is the foundation for all knowledge - Unknown.
Reply With Quote
  #5  
Old 04-26-2010, 09:16 AM
vb5prgrmrBreakout programming problems. vb5prgrmr is offline
Senior Contributor

* Expert *
 
Join Date: Mar 2009
Posts: 1,087
Default

I'm betting this is the result of the lack of use of Option Explicit...
__________________
Just because I'm an expert does not mean I know it all and just because I know it all does not mean I'm an expert
Reply With Quote
  #6  
Old 04-29-2010, 05:48 AM
DreamingInCode DreamingInCode is offline
Newcomer
 
Join Date: Apr 2010
Posts: 4
Default

I'd agree with Qua, it doesnt sound like you are reseting the value of the lives and the score counter after the player chooses to play again. I can't work out much more without snippets
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
Breakout programming problems.
Breakout programming problems.
Breakout programming problems. Breakout programming problems.
Breakout programming problems.
Breakout programming problems.
Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems. Breakout programming problems.
Breakout programming problems.
Breakout programming problems.
 
Breakout programming problems.
Breakout programming problems.
 
-->