Giter VIP home page Giter VIP logo

animação Hello World

This animation is made with points in a Python collections.deque data structure, added by dragging the mouse (code shown bellow)

  • 🔭 I'm currently working on a PhD at Unicamp.
  • 🌱 I should be talking less and concentrating, but...
  • 💬 Ask me about drawing with Python!
    • Check out py5 and pyp5js, they bring in the vocabulary from Processing & P5js!
    • I try to make a new drawing with code everyday, and I put the results at skech-a-day.
  • 👯 I’d like to collaborate on open resources to teach programming.
  • 😄 Pronouns: he/him
  • 📫 How to reach me: Mastodon or Email.
  • ⚡ Fun fact: I actually use this repo to store some helper code I use in my drawings.
from collections import deque  # a double-ended queue
import py5  # check out https://github.com/py5coding 

history = deque(maxlen=512)  # mouse dragged positions

def setup():   # py5 will call this once to set things up
    py5.size(600, 400)
    py5.no_stroke()
    py5.color_mode(py5.HSB)

def draw():   # py5 will call this in a loop
    py5.background(51)
    for i, (x, y) in enumerate(history):
        py5.fill(i / 2, 255, 255, 128)
        py5.circle(x, y, 8 + i / 16)
    if history:
        history.append(history.popleft())

def mouse_dragged():  # py5 will call this when you drag the mouse
    history.append((py5.mouse_x, py5.mouse_y))
    
def key_pressed():   # py5 will call this when a key is pressed
    history.clear()

py5.run_sketch()

Alexandre B A Villares's Projects

bomberman_py icon bomberman_py

Versão Python Mode do clone de "Bomberman" criado na oficina de desenvolvimento de jogos da Noite de Processing em 27/02/2018.

capa icon capa

Uma exposição virtual permanente de arte digital, de auto-curadoria e de ordem aleatória.

lousa-magica icon lousa-magica

Lousa mágica e Lousa paramétrica são máquinas de desenhar com potenciômetros! (Processing + Arduino)

magictools icon magictools

:video_game: :pencil: A list of Game Development resources to make magic happen.

markdown_translation icon markdown_translation

A script and Docker environment for running automated open source translations of batches of Markdown files using LibreTranslate

material-aulas icon material-aulas

Material para ensino introdutório de programação com Python em um contexto visual

mestrado icon mestrado

Documentação do mestrado ATC FEC/Unicamp 2017-2019

pensepython2e icon pensepython2e

Tradução do livro Pense em Python (2ª ed.), de Allen B. Downey com comentários e anotações das pessoas participantes do clube de leitura Python

pinga icon pinga

Interactive Genetic Algorithm in Processing (Python mode)

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.