Re: [pygame] How to draw a simple circle and make it move with keyboard input?

2018-11-30 Thread Irv Kalb
Hi, For continuous movement, you deal with the keyboard a different way. You don't check for a keyboard event, because the events only happens when you press the key down or let up on the key. Instead, every time through your loop, you query the state of the keyboard. It gives you back a Boo

Re: [pygame] How to draw a simple circle and make it move with keyboard input?

2018-11-30 Thread Marc-Alexandre Espiaut
Hello, Thank you for your answer. I’m hoping the this was not a homework assignment (I am a teacher). No, I am a PhD student. It was for my own sake. But, because you showed your code, I’ll help you out. Thank you, as I’ve been a student in the past, and might be a teacher also in a ne

Re: [pygame] How to draw a simple circle and make it move with keyboard input?

2018-11-30 Thread Irv Kalb
Hi, I'm hoping the this was not a homework assignment (I am a teacher). But, because you showed your code, I'll help you out. Most of your code was fine, but some things were in the wrong place. The basic idea is that there should be a main loop, and in that loop, you check for events (key

[pygame] How to draw a simple circle and make it move with keyboard input?

2018-11-30 Thread Marc-Alexandre Espiaut
Hello, I’ve tried to make a simple pygame code. I would like to draw a circle, and make it move with keyboard input. I would like to achieve that with the most minimalist code possible, but so far I don’t manage to do such a thing. Here is my non working code for reference: |#!/usr/bin/env