Skip to content
Help using getch
Profile icon
Trex10

Hello,
In this program I'm trying to make a letter run around the screen using WASD, is there any built in getch(or python/any other module) function that can help me with this? If not, can you show me how to do this since I'm having some difficulties with the letter jumping two spaces and only backing up once.

You are viewing a single comment. View All
Answered by Coder100 [earned 5 cycles]
View Answer
Profile icon
SixBeeps

From what I've seen, the getch package (which you're using now) is pretty much your only option. Can't tell you why you're getting double triggers especially since you're flushing the buffer already, but I can confirm there is no built-in getch.

Profile icon
Trex10

@SixBeeps

I really don't know what the flush thing or almost everything else in that line does. I just found it on StackOverflow and put it in here

Profile icon
Trex10

@SixBeeps

Also, I meant to ask is there something built into getch that allows me to move the letter?

Profile icon
SixBeeps

@Trex10
Nope, there wouldn't be a good enough reason for them to.

Profile icon
Trex10

@SixBeeps

ok, I gtg right now so I guess I'll have to fix the issues later I'll be back tomorrow.