Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 I cant get 2 player game on one keyboard
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
DanShadow




PostPosted: 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
Sponsor
sponsor
Mazer




PostPosted: 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




PostPosted: 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, Wink
Mazer




PostPosted: Tue Dec 02, 2003 12:46 pm   Post subject: (No subject)

Naughty never listen to your teacher. your old teacher that is. from now on, i am your teacher. uh... class dismissed.
McKenzie




PostPosted: 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




PostPosted: 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 Rolling Eyes

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 Confused
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Mazer




PostPosted: 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 ( Wink )
McKenzie




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: Tue Dec 02, 2003 7:13 pm   Post subject: (No subject)

McKenzie wrote:
The stories I could tell


maybe you can start a thread in general discussion about some of those stories? for our amusement Laughing

from personal experience... I found it a bit discouraging to be told that I've exided(spelling?) teacher's knowledge by the end of grade10 course (dont get me wrong... I had a really good teacher back then).

But still... schools probably just dont pay enough to hold a good CS teacher (and I go to private school Rolling Eyes)
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Chimaera




PostPosted: 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




PostPosted: 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 Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 11 Posts ]
Jump to:   


Style:  
Search: