473,397 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

'namespace' is used like a 'type'

Ok well Im new to the programming world and Im trying to make and Invaders type game for a class and needing some help on an error.

public class MenuBaseGameState : GameState
{
//a SpriteBatch and font to render the menu
SpriteBatch spriteBatch;
SpriteFont font;

//the actual menu object
protected Menu Menu = new Menu();

The bolded part is the problem.
Nov 13 '09 #1
7 10837
Plater
7,872 Expert 4TB
Its actually the word AFTER the bolded one I would say. You are naming the object the same as the type.
For simplicity's sake, try calling it "MyMenu":
protected Menu MyMenu = new Menu();
Nov 13 '09 #2
Ok that fixed that error but for some reason now the GameStateManager is not working. This time the error is:

The type or namespace 'GameStateManager' could not be found (are you using a directive or an assembly reference?)
Nov 13 '09 #3
RedSon
5,000 Expert 4TB
Are you using the XNA menu sample?
Nov 13 '09 #4
Pretty much yeah with a few extra options for sound in there
Nov 13 '09 #5
Plater
7,872 Expert 4TB
Do you have the XNA libraries installed and the references added to your project?
Nov 13 '09 #6
RedSon
5,000 Expert 4TB
Are you using the provided project files for that sample project that you downloaded from the XNA website?

I have a project hosted on google code that expands on that sample for Zune devices.
Nov 13 '09 #7
Would it help if I upoaded my code? If so where do youwant it uploaded to?


Well I fixed most of my issues, now imback at the namespace error with the same line of coded. I changed to the one stated above but it still gives me the error.
Nov 13 '09 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Blair Hall | last post by:
Can anyone please tell me how to correctly use a built in function when there is a function of the same name in local scope? Here is an example. Suppose the following is in myApply.py: def...
1
by: John L. Clark | last post by:
I am curious as to the rationale, and effect, of having default namespaces not applying (directly) to attributes (see http://www.w3.org/TR/REC-xml-names/#defaulting). Given an attribute without a...
8
by: ma740988 | last post by:
Consider // file fft_data.h class FFT_DATA { public: static const unsigned int Data_Words = 10; struct Data_Block_Type {
7
by: Kevin Newman | last post by:
I've been toying with a namespace manager, and wanted to get some input. So what do you think? if (typeof com == 'undefined') var com = {}; if (!com.unFocus) com.unFocus = {}; ...
20
by: Patrick Guio | last post by:
Dear all, I have some problem with insertion operator together with namespace. I have a header file foo.h containing declaration of classes, typedefs and insertion operators for the typedefs in...
6
by: Martin | last post by:
Hi, I have a xml file like the one below <?xml version="1.0" encoding="utf-8"?><e1 xmlns:e1="http://tempuri.org/Source1.xsd" e1:att1="1" e1:att2="2" e1:rest="345"/> If I try to create a...
9
by: MDoyle | last post by:
Here is the easiest question you’ll get all day from a complete newbie. I installed Visual Studio on my laptop last night and have been tryin to write my very first C# programs this morning. I’m...
30
by: Pep | last post by:
Is it best to include the code "using namespace std;" in the source or should each keyword in the std namespace be qualified by the namespace tag, such as std::cout << "using std namespace" <<...
6
by: Juha Nieminen | last post by:
Whenever one sees example C++ code basically anywhere, be it in a book, in a tutorial in the internet, in an online forum or whatever, I would estimate that at least in 99% of cases one sees the...
1
by: leno | last post by:
Hi all, I'm having this problem when i combined multiple schema's into one. The error msg is below: Unable to load schema with target namespace 'http://www.tdbanknorth.com/IFX170_TDBN' from...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.