GETKEY PRIORITY BY ROSS8653 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ross8653@hotmail.com icq# 21361440 or nickname ross8653 いいいいいいいいいいいいいいいいい So what the heck is getkey priority??? Well its something little that might help your game or program, and help you to elimate bugs that you can't figure out where they are. Here is the basic idea, there are different levels of getkeys so when holding down one of the keys at a lower level, when you push down a key at a higher level it will switch to that higher level key. But when you hold down one at a higher level and then you push one at a lower level it won't change because higher levels have priority. And lastly if you hold two keys with the same priority the getkey will change to 0. Simple right? heh i'll explain ================================================================ All examples in this document are referenced by the following program, i suggest you make it and run it so you can better understand getkey priority. ClrText Do If Getkey=0 Then Locate 2,1," " (one space) Ifend Locate 1,1,Getkey LpWhile X=X ================================================================ Here are all the different levels 1. F1 F2 F3 F4 F5 F6 2. (up) (down) (left) (right) 3. shift ctrl optn menu 4. alpha vars ^ esc 5. x,(theta),T log ln sin cos tan 6. Ab/c x^2 ( ) , -> 7. 7 8 9 del 8. 4 5 6 X(multiply) /(divide) 9. 1 2 3 + -(subtract) 10. 0 . exp -(neg) exe 11. AC/on ================================================================ You might be wondering why i put ac/on at the bottom right? Well try this, run the program that i have at the top, push and hold ANY key on the calc. Now push AC while holding that key, what happened?? nothing... thats why. Remember that if you hold down a higher priority and push a lower level nothing will change. But if you hold a lower level and push a higher then it will change to the higher level. If you hold two or more keys on the same level then the getkey will change back to zero. So how will this help you, and why do you care? because you can create cheats and getkey functions where you have to hold down two keys at the same time here is how you would do something basic, to enter this cheat push optn 6 9, yes this is the cheat for my drugwar game 1->X clrtext do getkey=58 => 2->X getkey=53 and 2=X => 3->X getkey=54 and 3=X => 4->X lpwhile X =/= 4 (lpwhile x doesn't equil 4) "cheat entered" But if you want to make one where you have to hold down keys then run this program. Hold down alpha then push shift. 1->X clrtext do if getkey=77 then do getkey->A A=78 => 2->X lpwhile A=77 and X=1 ifend lpwhile X =/= 2 (lpwhile x doesn't equil 2) "cheat entered" you might ask why i did getkey->A in line 6? Without that when you push 78 the program might already be past the part A=78 => 2->X (line 7) and it will hit the lpwhile, since A doesn't equil 77 it will break out of that loop and you have to release shift and push it again So knowing all of this have some fun, and remember always try to make your game have a lasting game play value. Ways that I use are save/load game, high scores, cheats, in game help or menus, and easy button entry or arrows pointing to options that you can move. And please make your game in ONE file it's not that hard. If you need to jump to somewhere use lbl's and goto's I hate it when i get this game that is supposed to be great and it has 10 files in it so i cant find all my other games. Adding these options makes your game a little bigger but it's worth it, I would rather have one great game rather than 10 games that are just ok and clutter my program list. <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< any questions, comments or flames? (not flammers) contact info is above (push ctrl home) >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>