About 5,790,000 results
Open links in new tab
  1. How to import pygame in visual studio code? - Stack Overflow

    Jan 26, 2019 · To elaborate on @Mehrdad's suggestion: There's a section on installing matplotlib in the Install and use packages section of the Visual Studio Code Get Started Tutorial. …

  2. How to make an object "jump" in pygame - Stack Overflow

    Jul 22, 2018 · Just check if isJump is true and then execute the jumping code in the jump method. I also recommend adding the isJump and jumpCount as attributes to Mario, so that you don't …

  3. python - How to get keyboard input in pygame? - Stack Overflow

    pygame.key.get_pressed() returns a list with the state of each key. If a key is held down, the state for the key is 1, otherwise 0. It is a snapshot of the keys at that very moment The new state of …

  4. python - How do I detect collision in pygame? - Stack Overflow

    Apr 15, 2015 · The collision of pygame.sprite.Sprite and pygame.sprite.Group objects, can be detected by pygame.sprite.spritecollide(), pygame.sprite.groupcollide() or …

  5. python - Pygame mouse clicking detection - Stack Overflow

    Jun 12, 2012 · The pygame documentation for mouse events is here. You can either use the pygame.mouse.get_pressed method in collaboration with the pygame.mouse.get_pos (if …

  6. How to add a background image into pygame? - Stack Overflow

    Jan 18, 2015 · 16 new to pygame just wondering how i would go about adding a background image into the game itself? this is my code so far, i've been using the bg as a way to import …

  7. Pygame: how to change background color - Stack Overflow

    pygame.display.update() # Refresh the screen, needed whatever the color is, so don't remove this So now, when you need to recolor the screen, just change currentColor to whatever you need, …

  8. ImportError: No module named 'pygame' - Stack Overflow

    Aug 19, 2013 · For this you have to install pygame package from the cmd (on Windows) or from terminal (on mac). Just type pip install pygame .If it doesn't work for you, then try using this …

  9. How to make a character jump in Pygame? - Stack Overflow

    I want to make my character jump. In my current attempt, the player moves up as long as I hold down SPACEv and falls down when I release SPACE. import pygame pygame.init() window = …

  10. How to make buttons in python/pygame? - Stack Overflow

    I don't have a code example for you, but how I would do it is to: Make a Button class, with the text to go on the button as a constructor argument Create a PyGame surface, either of an image or …