Allegro.cc - Online Community

Allegro.cc Forums » Off-Topic Ordeals » Allegro 5 Book

This thread is locked; no one can reply to it. rss feed Print
Allegro 5 Book
weapon_S
Member #7,859
October 2006
avatar

i have already made the social network and this is why i am turning my back to web.

Not to sound condescending, but why not put energy into promoting/expanding that? ???
A 'book' is an excellent project for the Wiki. Although, a separate book might have its merits too: more condensed an overview.
If you think you need a need a book, it apparently is hard for you to process the information you are looking for on your own. If so, I would say you aren't the right person to write that book.

someone972
Member #7,719
August 2006
avatar

The basic problem with a game programming book is that there is such a great span of game types, and they take an incredibly varied amount of libraries and coding strategies to implement. Covering everything you could ever need in a book is simply impractical. However, tutorials and examples on Allegro 5 definitely can help. Perhaps something more useful to focus on would be how to design a game. Determining what is needed to implement an idea and then how to find and integrate an existing library, or some guidance on how to begin to create one should one not fit the needs of the game, would be much more useful than showing how to do very specific things. That being said, it could use examples with specifics to help explain and enforce how the information presented could be used. It could even categorize and list some existing libraries/terms to aid in finding the right library.

Knowing the syntax of a programming language or the specifics of how to use a library is only part of being able to truly program. Most of the hard work is learning how to design and implement code within the restrictions of the programming language and libraries that gets one closer to bringing an idea to life. Programming languages and libraries are merely tools; someone can know how to use a saw and hammer, but if they can't think of a design for a cabinet the tools are useless.

Also, because tone and attitude are lost in text, I'd like to make that you know I am not directing this at you or trying to talk down to or criticize anyone. These are merely my thoughts and opinions; I recognize that just because I thought of them does not mean that they are truth. I would love to see someone's different opinion, and hope that you can find what you are looking for with Allegro :).

______________________________________
As long as it remains classified how long it took me to make I'll be deemed a computer game genius. - William Labbett
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why. -Unknown
I have recklessly set in motion a chain of events with the potential to so-drastically change the path of my life that I can only find it to be beautifully frightening.

AleX-G Squadron
Member #13,593
October 2011
avatar

Ok, today i got up and started writing the book.
I guess no comments stopped me?!
Just kiddin.
I dont waste my time with the social network because i want the knowledge from computers and not money. People sell their info for paper. I am not that kind of guy.
Most of game programmers start selling their work during the journey to create what they really wanted. This is 100% true, especially with the games nowdays which are awful. And i call an enginner someone who makes a car. Really, these are very hard rules, but you cannot refer yourself as a web developer because you just made a website, or a registration form. Or a game developer because he made super mario. I apply very strict rules to get the knowledge. If you want to get the money, than a basic website, or super mario will make you millions of money. Or the engineer, if he knows how to format the pc.... than he is an engineer! He will get the money.
So judging by knowledge, only when you made a social network you know most things developing websites, after making tomb raider (at least IV) than you have great knowledge, meaning that is perfect, what else could you want more? Same with the car.
After writting the chapter, i dont know if anyone is going to help.
I assume 100 pages in total but it wont be made today!
Also, i tried allegro with visual studio 2012 using monolith of VS2010 installment and it amazingly worked! So i assume the tutorial will be made with visual studio 2012.

@bam
That helped

@am
Q1)Actually i am trying to learn as much as possible from computers

Q2)The game with network

EDIT: Just made the cover

www.anothergames.com

Trent Gamblin
Member #261
April 2000
avatar

I thought it was a law of the universe that if you started a book with the cover (or a game with the logo) that you'd never finish.

Elias
Member #358
May 2000

What about starting the game with the title screen? I think I did that in some speed hack entry and finished it.

--
"Either help out or stop whining" - Evert

alehbeer
Member #12,996
July 2011
avatar

The manual is not simple ..[later on].. My question is: allegro 5 book. Any? NO! Epic fail.

Man, I completely disagree. I hold the allegro manual as one of the most well documented and organized library manual I know of. Not to mention the community has been amazing. Epic, no doubt.

Wha? You could write each of those chapters in 1 page.

Agreed. AleX! Write a 10 page document and fill the rest with a picture tutorial how-to! I would be sincerely interested in your picture tutorial on iOS dev.

There is no jokes on programming.

Oh, oh! I got this: "Programming is like sex: One mistake and you have to support it for the rest of your life." Find more at http://www.devtopics.com/best-programming-jokes/

Can your game run google?

Why yes, yes it can. I have made accounting software which could run google. And I have made a browser (early 90s) which could run google.com. Both have easteregg snake games. :o

Programming languages and libraries are merely tools; someone can know how to use a saw and hammer, but if they can't think of a design for a cabinet the tools are useless.

Very well said.

And i call an enginner someone who makes a car.

Sure... that makes sense. Let's forget the who definition of the word. Nevermind biomedical engineering, electrical engineering, chemical engineering, software engineering, etc. And about the not a game programmer thing, I think just about everyone on this site can fairly call themselves such.

As for web development, i have already made the social network and this is why i am turning my back to web.
And btw, i saw your game...

Social networking, huh. You might be doing it wrong.

Arthur Kalliokoski
Second in Command
February 2005
avatar

I thought it was a law of the universe that if you started a book with the cover (or a game with the logo) that you'd never finish.

IIRC, I've read that back in the '30's, artists would paint science fiction themed subjects for the pulp magazines, and authors would have to craft a story around those.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

AleX-G Squadron
Member #13,593
October 2011
avatar

The book is already 6 pages.... I thought it would take much more!
But i wont publish it immediately as i dont want to make any mistake.
I will try all code again, add some other things or chapters and more.
I laughed so much from the replies, as i knew none will give an opinion.
I will laugh again when i will come tomorrow! :)

Thanks for great replies!

www.anothergames.com

GameCreator
Member #2,541
July 2002
avatar

{"name":"13214306211.jpeg","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c5e2db7a466321e0aa5b867fc729570.jpg","w":300,"h":300,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/8\/c\/8c5e2db7a466321e0aa5b867fc729570"}13214306211.jpeg

http://www.amazon.com/Game-Programming-All-Jonathan-Harbour/dp/1598632892/ref=sr_1_1?ie=UTF8&qid=1345491954&sr=8-1&keywords=allegro+programming

someone972
Member #7,719
August 2006
avatar

I laughed so much from the replies, as i knew none will give an opinion.

It seems like there has been lots of opinions presented in this thread ???. Anyway congratulations on getting the first couple pages of the book done. If you need any examples double-checked or critiqued you can always post them here, but be warned: Allegro.cc is famous for being hard critics, as I'm sure you are aware ;).

______________________________________
As long as it remains classified how long it took me to make I'll be deemed a computer game genius. - William Labbett
Theory is when you know something, but it doesn't work. Practice is when something works, but you don't know why. Programmers combine theory and practice: Nothing works and they don't know why. -Unknown
I have recklessly set in motion a chain of events with the potential to so-drastically change the path of my life that I can only find it to be beautifully frightening.

bamccaig
Member #7,536
July 2006
avatar

alehbeer
Member #12,996
July 2011
avatar

... These are merely my thoughts and opinions ...

... I laughed so much from the replies, as i knew none will give an opinion. ...

Indeed, indeed.

All joking aside, here is how you do that magical teleport. Simply have a condition, evaluate for its validity in the current game-state and then change the position values as needed.

#SelectExpand
1//Please add proper error checking, spacing, and formating in your own program - it is removed here for simplicity only 2#include "allegro5/allegro.h" 3#include "allegro5/allegro_font.h" 4#include "allegro5/allegro_image.h" 5#include <allegro5/allegro_primitives.h> 6int main(int argc, char **argv){ 7 int i_x = 50; 8 int i_y = 50; 9 int i_done = -1; 10 ALLEGRO_DISPLAY *display = NULL; 11 ALLEGRO_EVENT_QUEUE *events; 12 ALLEGRO_EVENT event; 13 ALLEGRO_KEYBOARD_STATE kbdstate; 14 al_init(); 15 al_set_new_display_flags(ALLEGRO_WINDOWED); 16 display = al_create_display(640, 480); 17 al_set_window_title(display, "Teleport: Use the arrow keys to put the triangle at the X"); 18 al_install_keyboard(); 19 al_init_image_addon(); 20 al_init_primitives_addon(); 21 events = al_create_event_queue(); 22 al_register_event_source(events, al_get_keyboard_event_source()); 23 al_register_event_source(events, al_get_display_event_source(display)); 24 while(i_done != 1) { 25 al_clear_to_color(al_map_rgb(255,0,0)); 26 al_draw_line(100, 100, 150, 150, al_map_rgb(255,0 ,255), 5.); 27 al_draw_line(150, 100, 100, 150, al_map_rgb(255,0 ,255), 5.); 28 al_draw_filled_rectangle(400, 50, 450, 75, al_map_rgb(0,255 ,255)); 29 al_draw_filled_triangle(i_x-10, i_y,i_x,i_y-20.,i_x+10,i_y,al_map_rgb(0,0 ,255)); 30 al_get_keyboard_state(&kbdstate); 31 if (al_key_down(&kbdstate, ALLEGRO_KEY_LEFT)) {i_x-=5;} 32 if (al_key_down(&kbdstate, ALLEGRO_KEY_RIGHT)) {i_x+=5;} 33 if (al_key_down(&kbdstate, ALLEGRO_KEY_UP)) {i_y-=5;} 34 if (al_key_down(&kbdstate, ALLEGRO_KEY_DOWN)) {i_y+=5;} 35 if (al_key_down(&kbdstate, ALLEGRO_KEY_ESCAPE)) {i_done=1;} 36 if((i_x>100&&i_x<150)&&(i_y>100&&i_y<150)){i_x=420;i_y=75;} 37 al_flip_display(); 38 al_wait_for_event(events, &event); 39 } 40 al_destroy_display(display); 41 return 0; 42}

bamccaig
Member #7,536
July 2006
avatar

"How to teleport" is a ridiculous thing to teach somebody. It's very context-specific. Figuring out how to solve these problems yourself is what programmers are for. If you can't think your way through a problem like that then you aren't a programmer. If that's the case then you should be using game maker software or hire programmers. The import things to teach are lower-level than that. Things like collision detection and resolution. :-/

AMCerasoli
Member #11,955
May 2010
avatar

bamccaig said:

Things like collision detection and resolution.

Yeah, like when you crash your parents' car and need to think how to fix it before they see it.

Arthur Kalliokoski
Second in Command
February 2005
avatar

Yhea like when your crash your parent's car and need to think how to fix it before they see it.

Crashes can usually be figured out with a debugger.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

AleX-G Squadron
Member #13,593
October 2011
avatar

Wow! Thanks for teleport! I will try to understand the code as i am not that expert. I am working hard for the book and i hope people will understand one day its need.
The forum is a big critic, i know :)
Who wants to give a helping hand i will be grateful! :D

www.anothergames.com

AMCerasoli
Member #11,955
May 2010
avatar

Not these kind of crashes, my friend... Not these kind of crashes...

Do you know what is difficult about making a game?

media player

Do you know what is difficult about making a game
release the thing
make some fame
maybe sleep with some girls
have a name
see people reconigze my face
and walk on the street
and feal proud about me?
no cry 
no more bad thoughts about this
and the intrigue that all this causes
when you hear all those voices?

That nobody is helping you
Instead they're always questioning you
If you're able to do this
and if you really want to do this
and how much time are you going to spend on it
are you really motivated
are you really focused
Do you know this could take a lot of time
and you could gain nothing

Neil Black
Member #7,867
October 2006
avatar

This thread reminds me that I still haven't bothered to learn Allegro 5.

Is there, like, a book or something to get me started? :P

Don Freeman
Member #5,110
October 2004
avatar

I had plans to write a book for my war game engine, but sadly other things have taken over my life the last year or so...so it's been put on the back burner. I may try to find some spare time here and there, but with work and all...it will probably be a while before it comes anywhere close to being done. :(

--
"Everyone tells me I should forget about you, you don’t deserve me. They’re right, you don’t deserve me, but I deserve you."
"It’s so simple to be wise. Just think of something stupid to say and then don’t say it."

Arthur Kalliokoski
Second in Command
February 2005
avatar

It seems to me that writing a book is at least as hard as writing a computer program, after all, to write a good book about how to program is simply optimizing for a human, rather than a specific compiler. If your optimizations are crap, well then, your book can join all the worthless web pages already in existance.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

AleX-G Squadron
Member #13,593
October 2011
avatar

I was writing about native dialog boxes and read in the manual about them. The manual is very good, but does not unveil you things, for example making a native dialog box upside down or creating a timer which stays for 5 secs than closes the native dialog box. One thing i dont understand is why it is called native?
Again the manual is perfect, but for those who know the beginning.

www.anothergames.com

Arthur Kalliokoski
Second in Command
February 2005
avatar

making a native dialog box upside down

Why would you do that?

Quote:

making a native dialog box upside down or creating a timer which stays for 5 secs than closes the native dialog box.

The native dialog box isn't meant to be a generic window, more like to alert the user of a problem or make a choice. Even if you'd want to close it in 5 seconds to some default, it's not that big a deal to require the user to click OK or something.

Quote:

One thing i dont understand is why it is called native?

AFAIK, it's because it uses OS specific features, hence, native to the OS.

“Throughout history, poverty is the normal condition of man. Advances which permit this norm to be exceeded — here and there, now and then — are the work of an extremely small minority, frequently despised, often condemned, and almost always opposed by all right-thinking people. Whenever this tiny minority is kept from creating, or (as sometimes happens) is driven out of a society, the people then slip back into abject poverty. This is known as "bad luck.”

― Robert A. Heinlein

Trent Gamblin
Member #261
April 2000
avatar

Why would you do that?

And how? Pretty sure that's just not possible :P.

AleX-G Squadron
Member #13,593
October 2011
avatar

Thanks for the replies!
I am not that expert, i have just created a stupid game a year ago so i dont remember everything. It is not that i am talking about the 5 seconds or upside down in specific, but i mean in the manual are the most common functions.
Anyway, there is no problem with that.
I came upon another thing which i wanted to ask. The return -1 what does it exactly stand for in the "allegro" programming.
Another thing is why the word monolith? What does it mean in programming?

www.anothergames.com

Trent Gamblin
Member #261
April 2000
avatar

return -1 is often used as a "failure" return value in functions that return integers. It's not specific to Allegro but used in many C-like languages.

monolith means "all-in-one" I guess. The Allegro monolith DLL includes all the addons and dependencies in 1 single DLL.



Go to: