This project is read-only.

How to use the demo

First, build the project. The demo is based off of Going Beyond tutorials 1 and 2 in the xna help file. The controls are the same. Basically, use an Xna compatible gamepad to control the ship. The left stick rotates the ship, and the right trigger accelerates it. The more you press the trigger, the faster it goes, and the more the gamepad rumbles. If you get lost, press a to reset the ship. The start button resets everything.

However, this is a demo of the console, not a demo on how to draw a model, or how to control it with a gamepad. To open the console, press the ~ (tilde) key. You will be given a prompt that looks like this:

### Xna Console V.1.0.1

That blinking underscore is your cursor. Hopefully, it will act the way you expect it to. You can type letters in the normal fashion, and it even repeats characters when you hold them. You can move your cursor left and right with the left and right arrow keys, but only as far as the end of the line. You can also use the home and end keys to quickly reach the beginning and end of the line. Backspace and delete both work, and delete the previous and next characters respectively. The tab key currently adds four spaces.

Ok, now that you understand the basic features of the text input system, let's use the console to do something interesting!

First of all, the game adds itself to the interpreter as a global variable, so that we can access its members directly from the console. If you want to see what they are, type in:

>>> print dir(game)

This will print the members of game. Now that we know what they are, we can change some of them. Try changing the Acceleration, RotRate, and CameraPosition variables, and see how they effect the game. For example:

>>> game.Acceleration = 2.0

will make the ship move twice as fast when you pull the trigger the same distance.

>>> game.CameraPosition = Vector3(0, 5000, 1)

will put the camera directly on top of the ship.

The python interpreter included can handle multi line input, so the following will work:

>>> for i in range(10):
...     print i

It will start a multiline section when you end a line with ":", and will terminate the block when you enter a blank line. Note, the console does not as yet auto indent, or handle tabs. If you type in a tab, it will just output four spaces.

Finally, to close the console, just press the ~ key again. It will preserve your ouput and command history for you, so that it will still be there when you open it again. Of course, if you want to clear the output, just type in

>>> Console.Clear()

If you want to exit the game, you can type in:

>>> game.Exit()

Last edited Sep 30, 2009 at 11:41 PM by Shader, version 2


Eversor Nov 24, 2010 at 11:08 AM 
Ok, i have an Italian keyboard and i've seen there is an "Italian bindings" setup, any "best way" to use the console in my scenario? Thanks for the project, it's very useful!