millionairevorti.blogg.se

My keyclick switches.
My keyclick switches.





my keyclick switches.

Use the keyboard events for a single action or a step-by-step movement.Ĭreate a list of "switch" Surface. KEYUP occurs once every time a key is released. The KEYDOWN event occurs once every time a key is pressed. The keyboard events (see pygame.event module) occur only once when the state of a key changes. Use _pressed() to evaluate the current state of a button and get continuous movement. If a key is held down, the state for the key is True, otherwise False. _pressed() returns a sequence with the state of each key. I am looking for a way to switch my levers with 1 keybind "p" left right or middle repeat Thank You!įor this task you have to use the KEYDOWN event instead of _pressed(). If switch1.direction = "switch3" or switch1.direction = "switch1": Switch1 is the * left switch2 is the middle switch3 right one if keys: I am not sure if I am doing correctly but yeah On the right and we click p again it should switch my image back to 1 the middle one and like repeat In My Main Loop here what I have done for the first one I said if we click p then move1 should be True then if my move1 is true then it should switch my direction of my lever image to right one then my next one of my image is So I have a lever image with 3 different directions my problem is when I use the if mutliple times I want to switch between the defferent images but heres my problem VIDEO when I click p it display right and the middle one but not the left one and I have to hold the p for some reason to switch it I want it so when I click p 1 time it switches direction of my lever.







My keyclick switches.