Author |
Message |
DanShadow
|
Posted: Tue Dec 02, 2003 11:08 am Post subject: I cant get 2 player game on one keyboard |
|
|
a variety of games ive tried to make, like 'Asteroids', I need 2 player for. I have tried a few things, most recently resorting to the 'getch' command, but...well ill explain what happens.
Player 1: [a=move left ]
[s=move right]
Player 2: [4=move left ]
[6=move right]
If Player 1 is pressing 'a', moving left, and Player 2 presses any button, Player 1 stops moving, and Player 2 moves. I cant get them to simutaneously move using 1 keyboard. Someone plz help me! |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Mazer
|
Posted: Tue Dec 02, 2003 11:25 am Post subject: (No subject) |
|
|
this used to be a huge problem for making games in turing. luckily we now have Input.KeyDown
code: |
var chars : array char of boolean % array of all keys
loop
Input.KeyDown (chars)
if chars ('a') then
put "you are pressing the a key"
end if
end loop
|
it works something like that. i'm not sure exactly because i haven't used it in a while and don't have anything with me to check right now. |
|
|
|
|
|
DanShadow
|
Posted: Tue Dec 02, 2003 12:00 pm Post subject: yes |
|
|
Nice! Thanks alot, this helps everything! I actually used to use that, but my teacher told me getch was better...stupid teacher, |
|
|
|
|
|
Mazer
|
Posted: Tue Dec 02, 2003 12:46 pm Post subject: (No subject) |
|
|
never listen to your teacher. your old teacher that is. from now on, i am your teacher. uh... class dismissed. |
|
|
|
|
|
McKenzie
|
Posted: Tue Dec 02, 2003 2:20 pm Post subject: (No subject) |
|
|
Mazer,
Don't encourage him to be a punk. Yep, Shadow, your teacher dropped the ball on the Input.KeyDown, don't be so quick to assume he knows nothing. |
|
|
|
|
|
Tony
|
Posted: Tue Dec 02, 2003 4:19 pm Post subject: (No subject) |
|
|
McKenzie - it seriously depends on the teacher though... some seriously dont know anything... I dont even know how they get to teach computer science
A single mistake like that might not be enough to completely stop listening to the teacher, but clues like that add up...
Being a teacher yourself it might be hard for you to see student's perspective |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
Mazer
|
Posted: Tue Dec 02, 2003 6:05 pm Post subject: (No subject) |
|
|
i was only joking with him. danshadow, you should always respect your teacher. even though it may be difficult for you to do so because you don't have the greatest compsci teacher like i do ( ) |
|
|
|
|
|
McKenzie
|
Posted: Tue Dec 02, 2003 7:04 pm Post subject: (No subject) |
|
|
Don't get me wrong Tony, I've seen some of the worst of the worst (The stories I could tell.) I've taught beside guys who had no desire to teach CS nor had a clue. I know you're joking Mazer, but I also know how crushing it can be to be disrespected in a public forum. |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
|
|
|
|
Chimaera
|
Posted: Tue Dec 02, 2003 9:48 pm Post subject: (No subject) |
|
|
yea, some comp sci teachers just rely on a degree in math sciences and possibly just a minor in comp related subjects which is the case for my comp engineering teacher. She's awesome though, she understands what we want and she's a good teacher too. You can't go wrong with a teacher that likes the same sort of music as you do! |
|
|
|
|
|
DanShadow
|
Posted: Thu Dec 04, 2003 4:15 pm Post subject: hmm |
|
|
Ok. Problem is that I may know more than my compsci teacher, (in some areas) He never knew Turing was able to do anything with the internet, and thinks that making an RPG is amazingly hard. So...I do respect him, as he knows (some things) more than I, but overall....he has very little answers to the questions I have. That's one of many reasons I looked for a site like CompSci.ca |
|
|
|
|
|
|