XNA Creators Club Online
Page 1 of 1 (10 items)
Sort Posts: Previous Next

Designing a Game

Last post 9/12/2008 12:53 AM by Pur3 nicoiswoobie. 9 replies.
  • 9/3/2008 6:36 PM

    Designing a Game

     I have just finished learning C# and XNA2.0 but i was wondering if i wanted to make my own game from scratch how do i design buildings and people and stuff????
  • 9/3/2008 7:15 PM In reply to

    Re: Designing a Game

    You can start by checking out this FAQ
    Jim Perry - Microsoft XNA MVP
    If people spent a minute searching the forums and reading the FAQs before posting I'd be out of a job.
      Got some XNA Game Studio/XNA Framework development info to share with the community? Put it on the XNA Wiki.
        Please mark posts as Answers or Good Feedback when appropriate.
  • 9/3/2008 9:21 PM In reply to

    Re: Designing a Game

    what i meant is how do i devolp a background from scratch or a character from scratch? like how do i Draw something and then put it in a game???

     

  • 9/3/2008 9:35 PM In reply to

    Re: Designing a Game

    If you just got done learning XNA you should know how to draw an image on the screen. Use a paint program to make your image. Save it as bmp, jpg, or png. Add your image to the Content folder. In the LoadContent() method call Content.Load<Texture2D>("namewithoutextension"); Then in the Draw() method call spriteBatch.Begin(); spriteBatch.Draw(...); spriteBatch.End();

     

    There ya go. Something is drawn to the screen.


  • 9/4/2008 2:17 AM In reply to

    Re: Designing a Game

    Can someone please help me. I'm brand new to coding, I'm 15 and I can't seem to figure out why, when I follow everything in the freaking tutorial to creating the cannon game, the game won't start. I'm at the last part in chapter four where, I'm supposed to be doing the draw part. I input everything the tutorial says to in my project, and yet when I run the build/ green arrow thing, I come up with errors. It' says that there isn't a definition for 'begin' and 'end'. please help :(

     

  • 9/4/2008 2:18 AM In reply to

    Re: Designing a Game

    I'm also wondering, if i need anything else for the game to work properly. Because my sprites don't have that blue P1 thing next to the file name.
  • 9/4/2008 11:36 AM In reply to

    Re: Designing a Game

    I ran into same problems. your probaly making a couple simple spelling errors.
  • 9/5/2008 12:26 AM In reply to

    Re: Designing a Game

    Pur3 nicoiswoobie:
    It says that there isn't a definition for 'begin' and 'end'. please help :(

    In C# and XNA spelling and capitalization matter. To help identify the difference, I'll use SpriteBatch. Hopefully you're somewhat familiar with it. Whenever you see bold capital S SpriteBatch, I am referring to the class that handles drawing 2D sprites in XNA. When you see italic lowecase S spriteBatch, I mean an instance variable of that class. It's critically important for you to understand the difference, if you don't than I recommend you start looking for a beginner's introduction to C# programming tutorial before diving into games.

    In most of the samples, you'll find the coder has implemented SpriteBatch with a variable called spriteBatch. spriteBatch is an instance and will contain a definition of the methods Begin and End. SpriteBatch.Begin() will not compile because SpriteBatch is not an instance. You have to watch your capitalization because spriteBatch.begin() will not compile either. Only spriteBatch.Begin(); will work.

    A lot of people will rename spriteBatch so that it isn't so similar to SpriteBatch. For instance, sb. Just be sure you can remember that sb stands for spriteBatch and not anything else.

    IntelliSense (that box that appears when you begin writing code) will advise you about the members an object contains. If you type 'SpriteBatch.' or 'spriteBatch.' you should see IntelliSense appear with suggestions about how to finish the statement. If there are no suggestions or they aren't the suggestions you expected (such as Begin or End), you probably made a mistake and are referring to the wrong object, or to nothing at all.

    Another clue that you just made a formatting error occurs when you finish a statement with the semicolon (;). When you end a statement, Visual Studio will "clean up" the statement by removing any unnecessary spaces. But it will only do this if the statement is complete, so when you're writing code try pressing space and then ; and if the space goes away then you didn't make any obvious mistakes in the syntax for that statement.

    A similar clean-up happens when you close an open code block { } for instance a conditional statement or a loop. If the clean-up doesn't happen where one should than you need to stop writing code and find the errors in what you just wrote.

    After correcting a mistake you just made, sometimes the program still won't compile. Be sure to build the project again to see if the errors change. You won't always see every error in the code from one build because abstract errors won't be tested until fundamental ones are resolved. The errors are extremely helpful for fixing mistakes. You can even double click on them to focus directly on the line that's causing the problem. If that's not convenient, I don't know what is!

  • 9/5/2008 12:58 AM In reply to

    Re: Designing a Game

    what i meant is how do i devolp a background from scratch or a character from scratch? like how do i Draw something and then put it in a game?

    1. You download a good drawing program. Paint.NET is free and good; The Gimp is also free and scriptable (but the UI is... musterious)

    2. You draw the artwork you want to use -- guys, houses, etc. Draw them on a transparent background, and save as .png

    3. Add the png file as an asset in the game, and turn it into a sprite. Done!

    You may have trouble with 2 if you do not have any art/drawing skills. At that point, you start realizing why most games have at least two kinds of people contributing: artists, who draw/compose/animate, and programmers who program.

    Jon Watte, Direct3D MVP
    Tweets, occasionally
    kW X-port 3ds Max .X exporter
    kW Animation source code
  • 9/12/2008 12:53 AM In reply to

    Re: Designing a Game

    Thanks, MrLeebo for clearing that up, sorry I didn't get back. I've been busy with school, lots of homework lately.
Page 1 of 1 (10 items) Previous Next