Help using getch
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.
Voters
plscodeinjava
ur a noob
Trex10
@RYANTADIPARTHI
yes, I have my code like that,but is there any way I can do something like getch.pythonpoggers.movethingy to move the letter?
yes, I have my code like that,but is there any way I can do something like getch.pythonpoggers.movethingy to move the letter?
RYANTADIPARTHI
@Trex10 no, i don't think you can do it like that.
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.
I would recommend using curses for this. Not only does it have getch 'built-in' (getch was actually inspired curses), you can set it on the y and x
https://docs.python.org/3/library/curses.html
hmmmm, I'm confused, which thing would let me move the letter easier?
wat
@Trex10