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 🙂
Hey, thanks so much for these videos, really helped me in my projecT!!!
For deploying in Code:Blocks:
To build in release mode, on the upper most toolbar (where the file, edit, etc. are located) choose build menu, then in the “Select target” choose release.
===
For installers, there are many options, but the most straight forward one I can think of is using 7zip:
http://www.7-zip.org/
After you’ve downloaded and installed 7zip, put all of the needed files (such as PNGs, OGGs, etc.) including the allegro-5.x.x-monolith-md.dll (where x.x is the allegro version) in the same folder. Then select them all, right click->7zip->Add to archive…
In the menu that opens up there’s an “Options” section. Tick “Create SFX archive” in there and hit OK.
This will compress all your files into a single exe file which you can give to anybody.
I have Microsoft Visual Studio 2012 and i dont see option for Setup Wizard.Can you help me?
They removed setup projects in 2012. It is no longer an option. Check out install shield LE.
Oh god why!Please help how to do this using Code::Blocks?? :/
Sorry, I couldn’t tell you. I don’t use Code::Blocks.
Ah nevermind I’ve already found the way for codeblocks. 🙂 Thanks btw your tutorials are great it really helped me in making and understanding how to construct an Allegro game. 😀
Hi Mike,
firstly thanks for these tutorials they are epic.
You mention in this video about users might not be able to install if allegro isn’t installed, i am using visual studio 2012 and that is the problem im getting.
when i run the setup file on another computer it just says allegro-5.08-monolith cannot be found.
Any ideas what i did wrong?