|
if somebody press Esc he go to another function |
Albin Engström
Member #8,110
December 2006
|
WHAT THE F*** IS WRONG WITH YOU!? Seriously, how can a simple program with a really really simple menu take 1016 lines of space? And something even more disturbing: after 99 replies you still haven't learned? listen to people!. you want help but you refuse to listen? that's just stupid. if you don't understand anything that people say then you should not have asked, do you really just want to be a waste of time?. Please, you almost made me cry, and i haven't cried in years.. |
Evert
Member #794
November 2000
|
Quote: if you don't understand anything that people say then you should not have asked
Thing is, I can't work out how much of that is due to his poor English. You can't fault people for not speaking English natively. Quote: Evert but in my game haven't mistakes
You do, but that wasn't my point. I would also strongly recommend that you invest some time in improving your English. Try reading some English texts or books, or watch English movies/television (with subtitles). You'll need a dictionary for reading at first, but I think it's the best way to learn. |
a b
Member #8,092
December 2006
|
it is code which kaukiz suggest:
But it is obvious that this idea kaukiz is bad because if somebody will press ESC program won't exit. My idea was better in my previous code but it also wasn't perfect. I think that the best solution will be that in top right corner will "X" - and after click "X" game will exit - but how can I do it ? I know that we must use: |
Richard Phipps
Member #1,632
November 2001
|
Evert
Member #794
November 2000
|
Try using a different word for "bad" when someone's suggestion does not do what you want it to do. Quote: and after click "X" game will exit - but how can I do it ?
http://alleg.sourceforge.net/stabledocs/en/alleg000.html#set_close_button_callback Quote: but if somebody has resolution of monitor: 1024:768 program will wrong run because size window must be smaller than somebody's resolution of monitor - so what should I do if I want that my program runs good in also resolution of monitor 1024:768? Run fullscreen, or make sure the window is smaller. See http://alleg.sourceforge.net/stabledocs/en/alleg000.html#get_desktop_resolution. Here's another suggestion for your reading list: read through Allegro's manaul to get a rough overview of what's available and where you can find it. |
GullRaDriel
Member #3,861
September 2003
|
What Evert was thinking ( For the closing part )
What does not work with the ESC key, can you test that attached code, a b ? Have you really tried what all the others have said ? Test the attached binary to see if this code do what you want. Follow Evert's last advisement: there are enough examples and documentation in the allegro library distribution to make you understand how it works (it's commonly the case) _ "Code is like shit - it only smells if it is not yours" |
LennyLen
Member #5,313
December 2004
|
Quote: What does not work with the ESC key His program works exactly as it's suppsoed to (from the code's point of view). The problem is with the way it's written. Quote: Have you really tried what all the others have said ? If by tried you mean "randomly placing the example code you've been given somewhere in your program," then yes.
|
Kauhiz
Member #4,798
July 2004
|
Quote: But it is obvious that this idea kaukiz is bad because if somebody will press ESC program won't exit. There are so many things wrong with this sentence ... You can't just call function after function and zip from one procedure to the next. It'll look horrible and it won't work. You have to use states. That is: if your game is in the menu state, call the menu function. No loop inside the menu function, just call it once. If the game is still running, it'll loop over and the function will be called again. Same thing for every state your game can be in. LennyLen already provided basic example code for this. If you do that, all the problems you have addressed so far will pretty much be solved. If you refuse to do this, I refuse to help you. --- |
a b
Member #8,092
December 2006
|
So you want that my code will be:
now it is more complicated ................. |
Evert
Member #794
November 2000
|
For the love of *(&#*@# stop using key[] already! Look up flow control and loops in your favorite C book and get rid of those goto statements. |
tobing
Member #5,213
November 2004
|
I would like an option to ignore a thread. For now, I'll just mark it read instead. Anyway, sometimes it's quite fun to have a peek into this thread here. Never met anybody so impertinent and resistant to advice. |
Richard Phipps
Member #1,632
November 2001
|
He has no understanding, that's the problem. |
Evert
Member #794
November 2000
|
Quote: I would like an option to ignore a thread Isn't that what "hide thread" is for? |
piccolo
Member #3,163
January 2003
|
it "sucks" not knowing English. you will not find the right meaning for words like "sucks" in you translators. send me your project file zip if your using msvc++6 ill fix for you so you can move on edit its 2007 why are there no browser to bridge language bearers yet(like star track) wow |
a b
Member #8,092
December 2006
|
you use too difficult words in english so I can't understand everything and make everything what you say..... I translate my game to english half day but now I translated !! I work over this game all the time... ........ |
piccolo
Member #3,163
January 2003
|
here is one ways to fix
this is what i change to else if(key[KEY_ESC]){exitexit();} //new EDit: wow |
Evert
Member #794
November 2000
|
If you want to fix anything you can start by not discarding the return values of readkey(). Quote: you use too difficult words in english so I can't understand everything
Use a dictionary (there seem to be several on-line ones, try http://www.dict.pl/ or http://www.polish-dictionary.com/ - I don't know if they're good), |
piccolo
Member #3,163
January 2003
|
the problem was the trance of the manual. this is how it went down you was looking for things to do keyboard input. so you found readkey(); and key[]. what you did not trance is that they both are tools to do the same thing in 2 different ways. thats why you combined them. int val; val = readkey(); if ((val >> 8) == KEY_ESC){exitexit();} /* by scancode */ same thing if(key[KEY_ESC]){exitexit();}
wow |
Kauhiz
Member #4,798
July 2004
|
trance? --- |
piccolo
Member #3,163
January 2003
|
interpretation wow |
hexagon
Member #8,207
January 2007
|
piccolo, those two statements are not the same thing. http://www.allegro.cc/manual/api/keyboard-routines/readkey |
piccolo
Member #3,163
January 2003
|
quote: they both are tools to do the same thing in 2 different ways. wow |
Evert
Member #794
November 2000
|
No, they're not. readkey() and key[] serve completely different purposes. Sure, you can use one to emulate the other (sortof, you'll need keypressed() as well), but that's like using a knife to drive a screw. Or a screwdriver to cut your meat. |
hexagon
Member #8,207
January 2007
|
What do you mean by same thing? One waits for a key to be pressed and returns which key it is, |
piccolo
Member #3,163
January 2003
|
they are both tools that can be used to do something based on a key press.i gave examples in my post of them doing the same thing. wow |
|
|