This post is a portion of Part 14 in my on going series about 2D Game Development using the Allegro 5 library. These posts are in course order. You can see all of the posts in this course by clicking the “2D Game Development” button at the top of this site.
- 14.0 – Finishing Our Game
- 14.1 – Adding Game States to our Allegro 5 Game
- 14.2 – Adding a Background to our Allegro 5 Game
- 14.3 – Adding Audio to our Allegro 5 Game
- 14.4 – Deploying our Allegro 5 Game in Visual Studio 2010

Is there any way to do this in the Express version? It doesn’t seem to have any of those templates.
I apologize. Express edition does not allow setup projects. You can go here: http://msdn.microsoft.com/en-us/library/ms235291%28v=vs.90%29.aspx to see another way to deploy.
Which Visual Studio version of 2010 do you use?
I thought the only other version was Pro.
There is Express, Professional, Premium, and Ultimate.
Which versions allow the project setups to be made?
The ones that cost money….
Yes, unfortunately, that was an oversight of mine. I had not realized that the free ones would not allow the built in setup projects. I may do a video in the future on deploying with the free version, as there are other libraries that make this possible.
I use Visual Studio 2010 Developer edition
Thanks for the reply.
Could u possibly do a tutorial on user text input in a allegro 2d game, like for example asking the ”player” his/her name at the start and storing it to use later like when the scored is displayed?
//the following code show how to do a basic player name input (THIS IS NOT A FULL CODE)
ALLEGRO_EVENT_QUEUE *event_queue = al_create_event_queue();
al_register_event_source(event_queue, al_get_keyboard_event_source());
string player_name=”";
//draw function
bool done=false;
bool maius=false;//this tells you wen your pressing Shift
while(!done)
{
ALLEGRO_EVENT ev;
al_wait_for_event(event_queue, &ev);
if(ev.type == ALLEGRO_EVENT_KEY_DOWN)
{
switch (ev.keyboard.keycode)
{
case 215:
maius=true;
break;
case ALLEGRO_KEY_ENTER:
if (player_name.length() > 0)
{
//the code you want then you press enter
//done=true;//uncomment if u want the input to end here
break;
}
else break;
case ALLEGRO_KEY_SPACE:
if (palyer_name.length() > 0 && palyer_name.length() < name_limit)//in this case the name can't have more than 15 charecters
{
string algo;
ostringstream convert;
convert < 0)
{
palyer_name.erase(player_name.end()-1);
//draw function
break;
}
else break;
default:
if (player_name.length() < name_limit && ev.keyboard.keycode = 1)
{
string algo;
ostringstream convert;
if (maius == true)
{
convert << (char (ev.keyboard.keycode+64));
}
else
{
convert << (char (ev.keyboard.keycode+96));
}
algo = convert.str();
const char *outro = algo.c_str();
plyer_name.append (outro);
//draw function
break;
}
else break;
}
else if(ev.type == ALLEGRO_EVENT_KEY_UP)
{
if(ev.keyboard.keycode == 215)
{
maius= false;
}
}
}
al_destroy_event_queue(envent_queue);
From this code you will probably want to add a mouse input that do something like.. when you press the text box (you must make one inside your draw function) you will change a variable done_with_name to false and all the above code should be inside a while(!done_with_name), that way only when u press the textbox, you can type the player's name.
warning: Your draw function will need to recive the player_name string.
If you need other charecters than leters, just type after the if(ev.type == ALLEGRO_EVENT_KEY_DOWN), "cout << ev.keyboard.keycode<<endl;", then go to a ASCII code table and look for the key you pressed. after that its all about (char (ev.keyboard.keycode + correction)) where correction is the increment/decrement that you need to make, so that part correspond to the ASCII code you want