Console Minimum Tutorial

This tutorial will tell you what you need to know to get a blank Brutus2D console window working with no errors. It is the first step in learning to use the Console object. If you already know about Brutus2D objects, skip to the end of the tutorial.

Brutus2D Console Minimum

The Brutus2D console object is specially made to be an interface for old school text games. It is also an easy way to learn core programming using Brutus2D. The first step, of course, is to get the console window up and running, which is what this tutorial is all about.

If you already have some idea about Brutus2D objects, then you should have no trouble guessing what to do first. If you don't, don't worry, I'm going to explain it all as if you have no idea.

An Object

Brutus2D makes use of objects, which are kind of like useful helpers that do things for you. For most of them, the first thing you have to do is wake them up. Once you have them awake and ready, you can give them orders. Finally, at the end of your game, you should tell them to clean up their mess and go to sleep.

Creating the Console Window

To create the console window, all you have to do is initialize the console object. As soon as it is woken up, it automatically creates the console window for you.

console.Initialize

Ending the Game

The last thing you do in your code in a game using the console is put the console object back to sleep by terminating it.

console.Terminate

Together Now

Here is the absolute minimum to get the console window working :

console.Initialize
console.Terminate

Throw that in your Brutus2D code window and press F5. Did you catch it? If you didn't try it again. The console window will open and close so fast that it's barely visible, but it's there, and its error free.

A Pause

During your text games you will be pausing the game for a few seconds to generate suspense. You can use the same technique by using system.Pause. system.Pause pauses a Brutus2D game for a number of milliseconds. A millisecond is one-thousandth of a second. So, 2 seconds is 2000 milliseconds.

console.Initialize
system.Pause 5000
console.Terminate

You now have your error free console window.

Differences from the Graphics Object

The console object has one important difference from the Graphics object. The console object has is own way of using the keyboard built in, the graphics object does not.

Related Pages

Backlinks

These pages link back to this one. You may find them helpful.

This article is a stub. You can help us improve Brutus2D Wiki Complete by expanding it.
page_revision: 3, last_edited: 1215221089|%e %b %Y, %H:%M %Z (%O ago)