Giter Site home page Giter Site logo

pygameexamplesandanswers's Introduction

StackOverflow        reply.it reply.it        LinkedIn

"We learn more by looking for the answer to a question and not finding it than we do from learning the answer itself."
Lloyd Alexander, The Book of Three


PyGame Examples and Answers

PyGame - PyGame documentation

This repository is an excerpt and explanations of answers to PyGame questions published on Stack Overflow and answered by the author of this repository.
It does not contain an application, just a collection of examples. Initially I just wanted to bring order to a bunch of PyGame examples on my local drive. The examples should not be sophisticated, they should be kept as simple as possible. Each example should just spot one single issue. However, this is not a complete PyGame tutorial, but rather a FAQ.
This page provides links to the relevant Stack Overflow questions and live examples on repl.it. The examples are roughly divided into topics. My first language isn't English, but I did my best. I struggle with English grammar, which is the bill of my laziness at school.
The site is still under construction 🚧.

Testimonial

testimonial creature animation

📁 Sprite animation

repl.it/@Rabbid76/PyGame-CreatureAnimation**

Application, control flow and events

Event and application loop

Display, display position, update, resize, coordinate system and scroll

Keys and keyboard events

Mouse and mouse events

Joystick

Time, timer event and clock

Music and sound

Draw scene

Color

Rectangle

Surface and Image

Text and font

Draw shape and contour

Mask

Blending and transparency

Clipping

Sprite, Group, Sprite collision and Sprite mask

Move, scale and rotate objects

Scale and zoom surface

Rotate surface

Rotate towards target or mouse

Move towards target or mouse

Motion and movement

Jump

Background

Interaction between objects

Math and Vector

Collision and Intersection (Bounce, Pong, etc.)

Random and random distribution

Random movement

Raycasting

Enhanced

Surface and Image SVG

Surface and numpy/cv2

Surface array, pixel array, buffer proxy

UI elements

Threading

Camera and Video

Draw 2D

Draw 3D

Paint

Snake

Pong

Grid

Isometric

Memory

Maze

Tic Tac Toe

Tetris

Jump 'n' Run and Platformer

Game of life

Turtle

Miscellaneous

Code snippets

Ruun pygame in a web browser

Libraries

PyGame and PyMunk

Libraries based on PyGame

PyGame in combination with other libraries

PyGame and OpenGL

PyGame and OpenGL site map

PyGame Ray Tracing

See PyGame Ray Tracing repository.

Resources

PyGame - PyGame documentation
Github - pygame
Github - pygame/pygame
GitHub - CTPUG/pygame_cffi

pygameexamplesandanswers's People

Contributors

rabbid76 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pygameexamplesandanswers's Issues

Why do you use CompileProgram?

Hello,

I am sorry I don't understand what does it mean for CompileProgram?

Please use "normal" Modern OpenGL like
glCreateProgram, glAttachShader, glLinkProgram and glDetachShader

Sorry I don't like who has cheated function for Python. You know many coders miss understand what does it work for OpenGL under Python. Please make sure "legit" OpenGL 4

Thanks for the help!

This is the only way I could see to message you something, sorry.
Just wanted to thank you for your fantastic answer on https://stackoverflow.com/questions/56609044/how-create-a-camera-on-pyopengl-that-can-do-perspective-rotations-on-mouse-mov/56609894#56609894

Your answer really helped me for my school project. We are supposed to be making a 2D game with App Game Kit, but I decided to use Python and learn about 3D graphics. So my teacher can't really help me with OpenGL, but you sure did. I had no idea OpenGL had built in shading, that is gonna make my game look SO much better. Otherwise I was going to write a shitty colour gradient based on distance or somehting, but turns out a couple of OpenGL lines is all it takes! And for the mouse movement, which is how I found your answer, that will really help. I thought I would have had to use trigonometry and gluLookAt to rotate the camera on its Y axis, but your code will make that a lot easier.

Anyway, thanks so much for all the help you've given me and other people on stack overflow. Please consider adding an email to your stackoverflow or github, or allowing messages on twitter, so people can thank you more easily

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.