340 likes | 489 Views
Session 1.1. Computers, C#, XNA, and You. Find out what computers are all about ...and what makes a great programmer Discover how C#, XNA, and Microsoft Visual Studio fit together to allow you to make games See how to set up a development environment to create game programs
E N D
Session 1.1 Computers, C#, XNA, and You
Find out what computers are all about • ...and what makes a great programmer • Discover how C#, XNA, and Microsoft Visual Studio fit together to allow you to make games • See how to set up a development environment to create game programs • Run our first-ever XNA game Chapter 1: Computers, C#, XNA, and You Session Overview
A program is a list of instructions that tell a computer what to do • When you write a program you have to do two things: • Figure out how to solve the problem • Express your solution in a form the computer can understand • If you can’t do it, neither can the computer! Chapter 1: Computers, C#, XNA, and You COMPUTERS AND PROGRAMS
To be able to program you must be able to do two things: • Solve problems • Explain your solution to something very stupid (the computer) • There is actually a step 0 as well: 0. Find out what the customer wants • This is the most important step in real-world applications Chapter 1: Computers, C#, XNA, and You Learning to Program
Great Programmers are: • Knowledgeable – they know a lot about how to tell computers what to do and what computers are capable of doing • Creative – they enjoy finding new ways to do things • Good Company – they have to work with other programmers, and sometimes find out what the customer wants, even if the customer doesn’t actually know themselves • Persistent – they will keep working at a problem until they find a way to solve it Chapter 1: Computers, C#, XNA, and You Becoming a Great Programmer
You are going to find out how to write C# programs by creating games • You are also going to learn how games themselves are made to work, based on your experience with the XNA Framework • There will be lots of game examples along the way which you can make, play, and modify • There will presentations like this, practical sessions, and hands on practical activities • Along with the odd test.... Chapter 1: Computers, C#, XNA, and You How You Will Learn
The C# programming language • Used to tell the computer what to do • The XNA game development framework • A set of resources to help you make games • Visual Studio • A tool used to create, run, and debug programs Chapter 1: Computers, C#, XNA, and You Three Things To Learn
Lets you tell the computer how to do something You write programs as a sequence of simple steps A thing called a compiler converts your C# into computer instructions Chapter 1: Computers, C#, XNA, and You The C# Programming Language
A framework for creating games XNA Game Studio provides resources for game programmers XNA also runs the “game loop” Chapter 1: Computers, C#, XNA, and You The XNA Framework
An “Integrated Development Environment” (IDE) Where you write, run, and debug C# programs A “word processor” for software Chapter 1: Computers, C#, XNA, and You Microsoft Visual Studio
To get started you need to: • Install Visual Studio 2010 • Install XNA Game Studio 4.0 • Both these items are available for free • They will run on most modern Windows PCs which support Windows XP or Vista • You don’t need a massively powerful computer to learn to program with XNA • You can even use a NetBook Chapter 1: Computers, C#, XNA, and You Getting Started Creating Games
Visual Studio 2010 must be on your machine if you want to write XNA games • There are a number of versions; you can use the free “Express” version: http://www.microsoft.com/express/download/ • You can install this on a PC running Windows XP, Vista, or Windows 7 • This is the first step in building a place you can write games Chapter 1: Computers, C#, XNA, and You Installing Microsoft Visual Studio 2010
The XNA Framework is installed after Visual Studio It installs “on top” of it XNA Game Studio 4.0 is a free download from: http://creators.xna.com It adds game project types to Visual Studio 2008, along with some extra tools you can use to manage the games that you write There are also some sample games, but these are quite complicated Chapter 1: Computers, C#, XNA, and You Installing XNA Game Studio 4.0
Only Trial and Premium members of XNA Creators Club can send their games programs to an Xbox • Only Premium members of the XNA Creators Club can sell their games on Xbox Live • Trial membership is available to students • Premium membership costs $99 a year • You don’t need to join the Creators Club to run your game programs on a Windows PC or Zune • Creators Club Web site: http://creators.xna.com Chapter 1: Computers, C#, XNA, and You The XNA Creators Club
The PC sends XNA games into the Xbox 360 via the network connection The PC and the Xbox must be “bonded” together so they know about each other You do this once and both devices then remember the connection The XNA Game Studio Device Center program manages this for you XNA game programs are stored on the hard disk inside the Xbox, so you can play them later Chapter 1: Computers, C#, XNA, and You Linking a PC and an Xbox 360
The Zune portable music device can also run XNA programs You do not need to be in the XNA Creators Club to send game programs to your Zune The Zune is connected to the Windows PC using its USB cable The Zune and the Windows PC are “bonded” using XNA Game Studio Device Center XNA games are stored on the Zune hard disk Chapter 1: Computers, C#, XNA, and You Linking a PC and a Zune
Used to manage the connection between devices You can run it from within Visual Studio, or as a free-standing program Chapter 1: Computers, C#, XNA, and You XNA Game Studio Device Center
A game contains lots of content. This is the stuff that is not program code: • Graphics, sounds, level designs, scripts, help text • This must all be managed as part of the game so that when it is sent to the Xbox 360 it is all available for use • XNA Game Studio provides a Content Manager to look after this • Works with Visual Studio to create a project that contains everything the game needs to run Chapter 1: Computers, C#, XNA, and You Running Your First Game Program
Visual Studio will make you an empty game project • This is like giving a sculptor a block of clay • You select the target device when you make the project • You then add your program code and your content to make your game • Visual Studio will then use this project to build the game and send it to your target device • All XNA games start from the same empty project Chapter 1: Computers, C#, XNA, and You Making an Empty Project
Visual Studio provides commands to run and stop a game program • Visual Studio compiles the game program from C# into instructions the target can understand • The game program runs alongside Visual Studio • You can think of Visual Studio as the “Remote Control” for your game program • The game can also run “free standing” without Visual Studio Chapter 1: Computers, C#, XNA, and You Running a Game Project
Chapter 1: Computers, C#, XNA, and You 1. Creating an Empty XNA Game Project • It is very easy to create an empty XNA game project • It will even run • However, it won’t do much
XNA is a framework which is designed to be independent of the actual game hardware • Can run on a Windows PC, a Zune, or an Xbox 360 • Might even be new XNA devices in the future • When you create a game, you can consider running it on any one or all three of these platforms • Now you are going to find out how run the same game on a different device Chapter 1: Computers, C#, XNA, and You Using Multiple Hardware Platforms
People create projects to manage all the aspects of a job • A director of a play will have scripts, costume designs, sound effects, tickets, etc. • Visual Studio creates a project to keep all the items together for a particular game • The Content Manager looks after the game assets • A particular project is targeted at a particular XNA device Chapter 1: Computers, C#, XNA, and You XNA Project as Containers
A solution is a container for projects • Think of it as a filing cabinet that we can put plays in if you like • A solution can hold multiple projects so that a single game development can be aimed at different hardware • They can share the same program code, but perhaps use different asset files to match the target device • Visual Studio can copy projects from one device to another Chapter 1: Computers, C#, XNA, and You Making Multiple Projects in Solutions
Chapter 1: Computers, C#, XNA, and You 2. Making Multiple XNA Projects • You can copy a Windows PC project to run on either a Zune or an Xbox
Programs tell computers what to do • People write programs in a programming language (we use C#) to provide these instructions • XNA is a framework for writing computer games • Visual Studio is a tool for program (and game) creation • You can target a Windows PC, Xbox 360, or Zune with XNA games • To target Xbox 360 you need to be a “Trial” member of the Creators Club • To sell games you need to be a “Premier” member Chapter 1: Computers, C#, XNA, and You Summary
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz
Computers write their own programs XNA is a programming language Visual Studio is used to write C# programs You have to have a huge brain to write games You need to be in the Creators Club to write XNA games C# is just for writing games XNA stands for Xbox is Nicer than All other consoles Chapter 1: Computers, C#, XNA, and You True/False Pop Quiz