diff --git a/.gitignore b/.gitignore index fc62191c..75bc0667 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ # virutalenv directories /env*/ +.venv # coverage files .coverage diff --git a/README.rst b/README.rst index 7cbd3474..1c52c55d 100644 --- a/README.rst +++ b/README.rst @@ -144,19 +144,19 @@ Snake `Snake`_ -- classic arcade game. Use the arrow keys to navigate and eat the green food. Each time the food is consumed, the snake grows one segment -longer. Avoid eating yourself or going out of bounds! (`OO version`_) +longer. Avoid eating yourself or going out of bounds! (`OO version `_) .. image:: http://www.grantjenks.com/docs/freegames/_static/snake.gif :alt: Snake Free Python Game .. _`Snake`: http://www.grantjenks.com/docs/freegames/snake.html -.. _`OO version`: snake_oop.html Pacman ...... `Pacman`_ -- classic arcade game. Use the arrow keys to navigate and eat all the white food. Watch out for red ghosts that roam the maze. +(`OO version `_) .. image:: http://www.grantjenks.com/docs/freegames/_static/pacman.gif :alt: Pacman Free Python Game diff --git a/docs/index.rst b/docs/index.rst index 7207fdfc..bebd257d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -27,5 +27,6 @@ connect memory pacman + pacman_oop fidget madlibs diff --git a/docs/locale/pt_BR/LC_MESSAGES/api.po b/docs/locale/pt_BR/LC_MESSAGES/api.po index 5d143791..a2f829f0 100644 --- a/docs/locale/pt_BR/LC_MESSAGES/api.po +++ b/docs/locale/pt_BR/LC_MESSAGES/api.po @@ -4,118 +4,130 @@ # package. # FIRST AUTHOR , 2021. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Free Python Games 2.3.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-24 21:25-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2021-10-11 19:47-0300\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.1\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt_BR\n" +"X-Generator: Poedit 3.0\n" #: ../../api.rst:2 msgid "Free Python Games API Reference" -msgstr "" +msgstr "Referência da API do Free Python Games" #: ../../api.rst:4 msgid "" -":doc:`Free Python Games ` includes a few helpful utilities. The " -"best way to expose beginners to these functions is with Python's built-in" -" help function. Learners should be able to understand and write the " -"drawing functions themselves." +":doc:`Free Python Games ` includes a few helpful utilities. The best " +"way to expose beginners to these functions is with Python's built-in help " +"function. Learners should be able to understand and write the drawing " +"functions themselves." msgstr "" +":doc:`Free Python Games ` inclui alguns utilitários úteis. A melhor " +"maneira de expor os iniciantes a essas funções é com a função de ajuda " +"integrada do Python. Os alunos devem ser capazes de compreender e escrever as " +"funções de desenho por si mesmos." #: ../../api.rst:13 msgid "Drawing Functions" -msgstr "" +msgstr "Funções de Desenho" #: freegames.utils.line:1 of msgid "Draw line from `(a, b)` to `(x, y)`." -msgstr "" +msgstr "Desenhe uma linha de (a, b) a (x, y)." #: freegames.utils.square:1 of msgid "Draw square at `(x, y)` with side length `size` and fill color `name`." msgstr "" +"Desenhe um quadrado em (x, y) com o `tamanho` do comprimento lateral e " +"preencha o `nome` da cor." #: freegames.utils.square:3 of msgid "The square is oriented so the bottom left corner is at (x, y)." msgstr "" +"O quadrado é orientado de forma que o canto esquerdo inferior esteja em (x, y)." #: ../../api.rst:20 msgid "Helper Functions" -msgstr "" +msgstr "Funções de ajuda" #: freegames.utils.floor:1 of msgid "Floor of `value` given `size` and `offset`." -msgstr "" +msgstr "Piso de `valor` dado `tamanho` e `deslocamento`." #: freegames.utils.floor:3 of msgid "The floor function is best understood with a diagram of the number line::" -msgstr "" +msgstr "A função do piso é melhor compreendida com um diagrama da reta numérica:" #: freegames.utils.floor:8 of msgid "" -"The number line shown has offset 200 denoted by the left-hand tick mark " -"at -200 and size 100 denoted by the tick marks at -100, 0, 100, and 200. " -"The floor of a value is the left-hand tick mark of the range where it " -"lies. So for the points show above: ``floor(x)`` is -200, ``floor(y)`` is" -" 0, and ``floor(z)`` is 100." -msgstr "" +"The number line shown has offset 200 denoted by the left-hand tick mark at " +"-200 and size 100 denoted by the tick marks at -100, 0, 100, and 200. The " +"floor of a value is the left-hand tick mark of the range where it lies. So for " +"the points show above: ``floor(x)`` is -200, ``floor(y)`` is 0, and " +"``floor(z)`` is 100." +msgstr "" +"A linha de número mostrada tem deslocamento 200 denotado pela marca de escala " +"à esquerda em -200 e o tamanho 100 indicado pelas marcas de escala em -100, 0, " +"100 e 200. O piso de um valor é a marca de escala à esquerda do intervalo onde " +"se encontra. Portanto, para os pontos mostrados acima: o ``piso(x)`` é -200, o " +"``piso(y)`` é 0 e o ``piso(z)`` é 100." #: freegames.utils.path:1 of msgid "Return full path to `filename` in freegames module." -msgstr "" +msgstr "Retorna o caminho completo para o `nome do arquivo` no módulo freegames." #: ../../api.rst:27 msgid "Vectors" -msgstr "" +msgstr "Vetores" #: freegames.utils.vector:1 of msgid "Two-dimensional vector." -msgstr "" +msgstr "Vetor bidimensional." #: freegames.utils.vector:3 of msgid "Vectors can be modified in-place." -msgstr "" +msgstr "Os vetores podem ser modificados no local." #: freegames.utils.vector.__init__:1 of msgid "Initialize vector with coordinates: x, y." -msgstr "" +msgstr "Inicialize o vetor com as coordenadas: x, y." #: freegames.utils.vector.__add__:1 of msgid "v.__add__(w) -> v + w" -msgstr "" +msgstr "v.__add__(w) -> v + w" #: freegames.utils.vector.__mul__:1 of msgid "v.__mul__(w) -> v * w" -msgstr "" +msgstr "v.__mul__(w) -> v * w" #: freegames.utils.vector.copy:1 of msgid "Return copy of vector." -msgstr "" +msgstr "Retorna a cópia do vetor." #: freegames.utils.vector.move:1 of msgid "Move vector by other (in-place)." -msgstr "" +msgstr "Move o vetor por outro (no local)." #: freegames.utils.vector.rotate:1 of msgid "Rotate vector counter-clockwise by angle (in-place)." -msgstr "" +msgstr "Gire o vetor no sentido anti-horário pelo ângulo (no local)." #: freegames.utils.vector.scale:1 of msgid "Scale vector by other (in-place)." -msgstr "" +msgstr "Escala o vetor por outro (no local)." #: freegames.vector.x:1 of msgid "X-axis component of vector." -msgstr "" +msgstr "Componente do eixo X do vetor." #: freegames.vector.y:1 of msgid "Y-axis component of vector." -msgstr "" - +msgstr "Componente do eixo Y do vetor." diff --git a/docs/locale/pt_BR/LC_MESSAGES/curriculum.po b/docs/locale/pt_BR/LC_MESSAGES/curriculum.po index c7ab7a9c..585e777e 100644 --- a/docs/locale/pt_BR/LC_MESSAGES/curriculum.po +++ b/docs/locale/pt_BR/LC_MESSAGES/curriculum.po @@ -9,7 +9,7 @@ msgstr "" "Project-Id-Version: Free Python Games 2.3.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-24 21:25-0300\n" -"PO-Revision-Date: 2021-10-09 12:12-0300\n" +"PO-Revision-Date: 2021-10-09 20:11-0300\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -105,7 +105,7 @@ msgstr "Jogos" #: ../../curriculum.rst:32 msgid ":doc:`guess`.py - Guess number within range." -msgstr "" +msgstr ":doc:`guess`.py - Adivinhar um número dentro de um intervalo." #: ../../curriculum.rst:34 msgid "Explain: from random import randint" @@ -149,7 +149,7 @@ msgstr "Discuta o método de adivinhação. Isso é um algoritmo!" #: ../../curriculum.rst:45 msgid ":doc:`snake`.py - Classic arcade game." -msgstr "" +msgstr ":doc:`snake`.py - Jogo clássico de arcade." #: ../../curriculum.rst:48 ../../curriculum.rst:97 ../../curriculum.rst:139 #: ../../curriculum.rst:166 ../../curriculum.rst:191 @@ -210,7 +210,7 @@ msgstr "Módulos: turtle" #: ../../curriculum.rst:72 msgid ":doc:`crypto`.py - Encrypt, decrypt and decode messages." -msgstr "" +msgstr ":doc:`crypto`.py - Criptografar, descriptografar e decodificar mensagens." #: ../../curriculum.rst:74 msgid "ord function and chr function" @@ -218,7 +218,7 @@ msgstr "função ord e função chr" #: ../../curriculum.rst:75 msgid "modulo operator" -msgstr "operador de módulo" +msgstr "módulo operador" #: ../../curriculum.rst:76 msgid "Write decode function" @@ -230,7 +230,7 @@ msgstr "Criptografar números" #: ../../curriculum.rst:79 msgid ":doc:`paint`.py - Draw shapes." -msgstr "" +msgstr ":doc:`paint`.py - Desenhe formas." #: ../../curriculum.rst:81 msgid "Draw line" @@ -285,7 +285,7 @@ msgstr "Escrever função polígono(lados, comprimento)" #: ../../curriculum.rst:94 msgid ":doc:`flappy`.py - Flappy Bird inspired game." -msgstr "" +msgstr ":doc:`flappy`.py - Jogo inspirado em Flappy Bird." #: ../../curriculum.rst:99 msgid "Genesis 6:5-22 - God the Engineer (Noah)" @@ -325,7 +325,7 @@ msgstr "Funções: onscreenclick, onkey, ontimer" #: ../../curriculum.rst:117 msgid ":doc:`bagels`.py - Digit guessing puzzle." -msgstr "" +msgstr ":doc:`bagels`.py - Quebra-cabeça de adivinhação de dígitos." #: ../../curriculum.rst:118 msgid "Animation" @@ -353,7 +353,7 @@ msgstr "hideturtle(); marcador(False); polígono(4, 200); atualização()" #: ../../curriculum.rst:126 msgid ":doc:`tictactoe`.py - Tic-tac-toe." -msgstr "" +msgstr ":doc:`tictactoe`.py - Jogo da velha." #: ../../curriculum.rst:128 msgid "line(...)" @@ -381,11 +381,11 @@ msgstr "onscreenclick(goto)" #: ../../curriculum.rst:135 msgid ":doc:`simonsays`.py - Simon Says" -msgstr "" +msgstr ":doc:`simonsays`.py - Simon Says" #: ../../curriculum.rst:136 msgid ":doc:`cannon`.py - Hitting targets with projectiles." -msgstr "" +msgstr ":doc:`cannon`.py - Atingir alvos com projéteis." #: ../../curriculum.rst:141 msgid "Mark 1:1-18 - God the Programmer (\"fishers of people\")" @@ -397,7 +397,7 @@ msgstr "O que Isaías disse que aconteceria?" #: ../../curriculum.rst:144 msgid "What did John the Baptist say would happen?" -msgstr "What did John the Baptist say would happen?" +msgstr "O que João Batista disse que aconteceria?" #: ../../curriculum.rst:145 msgid "What did God say about Jesus? When?" @@ -425,23 +425,23 @@ msgstr "Tipos de dados: list, dict, vector" #: ../../curriculum.rst:159 msgid ":doc:`bounce`.py - Simple animation demo." -msgstr "" +msgstr ":doc:`bounce`.py - Demonstração de animação simples." #: ../../curriculum.rst:160 msgid ":doc:`pong`.py - Classic arcade game." -msgstr "" +msgstr ":doc:`pong`.py - Jogo clássico de arcade." #: ../../curriculum.rst:161 msgid ":doc:`ant`.py - Simple animation demo." -msgstr "" +msgstr ":doc:`ant`.py - Demonstração de animação simples." #: ../../curriculum.rst:162 msgid ":doc:`tron`.py - Classic arcade game." -msgstr "" +msgstr ":doc:`tron`.py - Jogo clássico de arcade." #: ../../curriculum.rst:163 msgid ":doc:`tiles`.py - Puzzle game of number shuffling." -msgstr "" +msgstr ":doc:`tiles`.py - Jogo de quebra-cabeça de embaralhamento de números." #: ../../curriculum.rst:168 msgid "John 9:1-33 - God the Debugger (Blind Man and Jesus)" @@ -481,15 +481,15 @@ msgstr "Resposta: O que vem a seguir?" #: ../../curriculum.rst:186 msgid ":doc:`connect`.py - Connect Four" -msgstr "" +msgstr ":doc:`connect`.py - Conecte quatro" #: ../../curriculum.rst:187 msgid ":doc:`memory`.py - Puzzle game of number pairs." -msgstr "" +msgstr ":doc:`memory`.py - Jogo de quebra-cabeça de pares de números." #: ../../curriculum.rst:188 msgid ":doc:`pacman`.py - Classic arcade game." -msgstr "" +msgstr ":doc:`pacman`.py - Jogo clássico de arcade." #: ../../curriculum.rst:193 msgid "Revelation 21 - God the Restorer (New Heaven and New Earth)" diff --git a/docs/locale/pt_BR/LC_MESSAGES/development.po b/docs/locale/pt_BR/LC_MESSAGES/development.po index 2dd074d9..ccca3ab0 100644 --- a/docs/locale/pt_BR/LC_MESSAGES/development.po +++ b/docs/locale/pt_BR/LC_MESSAGES/development.po @@ -4,12 +4,11 @@ # package. # FIRST AUTHOR , 2021. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Free Python Games 2.3.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-24 21:25-0300\n" +"POT-Creation-Date: 2021-10-09 18:46-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,149 +16,211 @@ msgstr "" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.1\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt_BR\n" +"X-Generator: Poedit 3.0\n" #: ../../development.rst:2 msgid "Free Python Games Development" -msgstr "" +msgstr "Desenvolvimento de Free Python Games" #: ../../development.rst:4 msgid "" ":doc:`Free Python Games ` development is lead by Grant Jenks " "." msgstr "" +":doc:O desenvolvimento de `Free Python Games ` é liderado por Grant " +"Jenks ." #: ../../development.rst:8 msgid "Collaborators Welcome" -msgstr "" +msgstr "Colaboradores são bem-vindos" #: ../../development.rst:10 msgid "Search issues or open a new issue to start a discussion around a bug." msgstr "" +"Pesquise issues ou abra uma nova issue para iniciar uma discussão sobre um " +"bug." #: ../../development.rst:11 msgid "Fork the `GitHub repository`_ and make your changes in a new branch." msgstr "" +"Faça um fork do `repositório no GitHub`_ e faça suas alterações em um novo " +"branch." #: ../../development.rst:12 msgid "Write a test which shows the bug was fixed." -msgstr "" +msgstr "Escreva um teste que mostre que o bug foi corrigido." #: ../../development.rst:13 msgid "" -"Send a pull request and message the development lead until its merged and" -" published." +"Send a pull request and message the development lead until its merged and " +"published." msgstr "" +"Envie um pull request e uma mensagem ao líder de desenvolvimento até que " +"seja mesclado e publicado." #: ../../development.rst:19 msgid "Requests for Contributions" -msgstr "" +msgstr "Pedidos de contribuições" #: ../../development.rst:21 msgid "Simplifications to existing games." -msgstr "" +msgstr "Simplificações de jogos existentes." #: ../../development.rst:22 msgid "Refactoring to simplify games." -msgstr "" +msgstr "Refatoração para simplificar os jogos." #: ../../development.rst:23 msgid "Improved documentation." -msgstr "" +msgstr "Melhoria da documentação." #: ../../development.rst:24 msgid "Additional games. Requirements for new games:" -msgstr "" +msgstr "Jogos adicionais. Requisitos para novos jogos:" #: ../../development.rst:26 msgid "Fun to play." -msgstr "" +msgstr "Divertido de jogar." #: ../../development.rst:27 msgid "Matching code style." -msgstr "" +msgstr "Estilo de código correspondente." #: ../../development.rst:28 msgid "Limited Python feature set." -msgstr "" +msgstr "Conjunto limitado de recursos do Python." #: ../../development.rst:29 -msgid "Short (less than 100 lines of code)." -msgstr "" +msgid "" +"Short (less than 100 lines of code, or 300 lines in oriented object " +"version)." +msgstr "Curto (menos de 100 linhas de código, ou 300 linhas na versão orientada " +"a objetos)" #: ../../development.rst:32 msgid "Get the Code" -msgstr "" +msgstr "Obtenha o código" #: ../../development.rst:34 msgid "" ":doc:`Free Python Games ` is actively developed in a `GitHub " "repository`_." msgstr "" +":doc:`Free Python Games ` é desenvolvido ativamente em um " +"`repositório no GitHub`_." #: ../../development.rst:37 msgid "You can either clone the public repository::" -msgstr "" +msgstr "Você pode clonar o repositório público::" #: ../../development.rst:41 msgid "" -"Download the `tarball `_::" +"Download the `tarball `_::" msgstr "" +"Baixe o `tarball `_::" #: ../../development.rst:45 msgid "" -"Or, download the `zipball `_::" +"Or, download the `zipball `_::" msgstr "" +"Ou, faça o download do `zipball `_::" #: ../../development.rst:50 msgid "Installing Dependencies" -msgstr "" +msgstr "Instalação de dependências" #: ../../development.rst:52 msgid "" -"Install development dependencies with `pip `_::" +"Install development dependencies with `pip `_::" msgstr "" +"Instale as dependências de desenvolvimento com `pip `_::" #: ../../development.rst:56 msgid "" "All packages for running tests and building documentation will be " "installed." msgstr "" +"Todos os pacotes para a execução de testes e documentação de construção " +"serão instalados." #: ../../development.rst:59 msgid "Testing" -msgstr "" +msgstr "Testando" #: ../../development.rst:61 msgid "" -":doc:`Free Python Games ` currently tests against three versions " -"of Python:" +":doc:`Free Python Games ` currently tests against three versions of " +"Python:" msgstr "" +":doc:`Free Python Games ` é atualmente testado em três versões do " +"Python:" #: ../../development.rst:64 msgid "CPython 3.4" -msgstr "" +msgstr "CPython 3.4" #: ../../development.rst:65 msgid "CPython 3.5" -msgstr "" +msgstr "CPython 3.5" #: ../../development.rst:66 msgid "CPython 3.6" -msgstr "" +msgstr "CPython 3.6" #: ../../development.rst:68 msgid "" -"Testing uses `tox `_. If you don't want" -" to install all the development requirements, then, after downloading, " -"you can simply run::" +"Testing uses `tox `_. If you don't want " +"to install all the development requirements, then, after downloading, you " +"can simply run::" msgstr "" +"Os testes usam `tox `_. Se você não " +"deseja instalar todos os requisitos de desenvolvimento, então, após o " +"download, você pode simplesmente executar::" #: ../../development.rst:74 msgid "" "The test argument to setup.py will download a minimal testing " "infrastructure and run the tests." msgstr "" +"O argumento de teste para setup.py irá baixar uma infraestrutura mínima de " +"testes e executar os testes." + +#: ../../development.rst:78 +msgid "Translate" +msgstr "" + +#: ../../development.rst:80 +msgid "" +"Translation files are available in the locale/ directory, if you want to " +"contribute a translation make changes to its content." +msgstr "" + +#: ../../development.rst:82 +msgid "" +"if you want to translate to another language, you need to create the lang" +" folder. To update the lang folder you need to use the command:" +msgstr "" + +#: ../../development.rst:84 +msgid "$ make update-po" +msgstr "" + +#~ msgid "Short (less than 100 lines of code)." +#~ msgstr "" + +#~ msgid "" +#~ "Translation files are available in the" +#~ " /locale directory, if you want to" +#~ " contribute a translation make changes " +#~ "to its content." +#~ msgstr "" diff --git a/docs/locale/pt_BR/LC_MESSAGES/index.po b/docs/locale/pt_BR/LC_MESSAGES/index.po index b431ba6a..ff591861 100644 --- a/docs/locale/pt_BR/LC_MESSAGES/index.po +++ b/docs/locale/pt_BR/LC_MESSAGES/index.po @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: Free Python Games 2.3.2\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-08-24 21:25-0300\n" +"POT-Creation-Date: 2021-10-04 21:57-0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -20,7 +20,7 @@ msgstr "" #: ../../../README.rst:2 msgid "Free Python Games" -msgstr "" +msgstr "Free Python Games" #: ../../../README.rst:4 msgid "" @@ -29,6 +29,11 @@ msgid "" "Python code and designed for experimentation and changes. Simplified " "versions of several classic arcade games are included." msgstr "" +"`Free Python Games`_ é uma coleção de jogos gratuita feita em Python " +"destinados à educação e à diversão licenciada com Apache2. Os jogos " +"são escritos em códigos simples de Python e projetados para experimentação " +"e mudanças. Estão inclusas versões simplificadas de vários jogos de arcade " +"clássicos." #: ../../../README.rst:9 msgid "" @@ -41,6 +46,14 @@ msgid "" " by Wally Feurzig and Seymour Papert in 1966. All of the games in `Free " "Python Games`_ are implemented using Python and its Turtle module." msgstr "" +"Python é uma das cinco linguagens de programação mais populares do mundo " +"e está disponível gratuitamente em `Python.org. " +"`_. Python inclui uma ampla biblioteca " +" padrão distribuída com sua instalação. A biblioteca padrão tem um módulo " +"chamado Turtle, que é uma forma popular de apresentar programação às crianças. " +"Turtle fazia parte da linguagem de programação Logo original, desenvolvida" +" por Wally Feurzig e Seymor Papert em 1966. Todos os jogos em `Free " +"Python Games`_ são implementados usando Python e seu módulo Turtle." #: ../../../README.rst:17 msgid "" @@ -49,6 +62,10 @@ msgid "" "much as it was to learn. Since then the games have been improved and used" " in a variety of settings ranging from classrooms to summer day-camps." msgstr "" +"A partir de 2012, `Free Python Games`_ começou como um programa pós-escola " +"para ensinar programação aos jovens do centro da cidade. O objetivo era " +"se divertir tanto quanto aprender. Desde então, os jogos foram melhorados e usados" +" em uma variedade de ambientes que vão de salas de aulas a acampamentos de verão." #: ../../../README.rst:22 msgid "" @@ -58,6 +75,11 @@ msgid "" "grades 6th-12th have enjoyed learning about topics such as encryption and" " projectile motion through games." msgstr "" +"Os jogos são executados em qualquer lugar que o Python possa ser instalado, " +"o que inclui computadores desktop com Windows, Mac OS ou Linux e hardware " +"mais “velhos” e de baixa potência, como Raspberry Pi. Crianças nos Estados Unidos, " +"da 6ª à 12ª série, gostaram de aprender tópicos sobre criptografia e movimento de" +" projétil através dos jogos." #: ../../../README.rst:27 msgid "" @@ -67,20 +89,27 @@ msgid "" " a new feature or behavior! You never know which games students will " "engage with best." msgstr "" +"Cada jogo é inteiramente independente dos outros e inclui comentários " +"com uma lista de exercícios para trabalhar com os estudantes. Criatividade " +"e flexibilidade são importantes. Não há forma certa ou errada de implementar" +" uma nova característica ou comportamento! Você nunca sabe com quais jogos os " +"estudantes se engajarão melhor." #: ../../../README.rst:36 msgid "Testimonials" -msgstr "" +msgstr "Relatos" #: ../../../README.rst:38 msgid "" "*\"I love Free Python Games because the games are fun and they're easy to" " understand and change. I like making my own games now.\"*" msgstr "" +"*\"Eu amo Free Python Games porque os jogos são divertidos e eles são fáceis" +" de entender e mudar. Eu gosto de fazer meus próprios jogos agora. \"*" #: ../../../README.rst:41 msgid "-- Luke Martin, Student" -msgstr "" +msgstr "-- Luke Martin, estudante" #: ../../../README.rst:43 msgid "" @@ -88,415 +117,482 @@ msgid "" "Thank you so much for exposing him to coding. He is having so much " "fun!\"*" msgstr "" +"*\"Free Python Games inspirou e introduziu um novo passatempo para o " +"nosso filho. Muito obrigada por apresentar ele à programação. Ele está " +"se divertindo bastante!\"*" #: ../../../README.rst:46 msgid "-- Mary Lai, Parent" -msgstr "" +msgstr "-- Mary Lai, mãe" #: ../../../README.rst:48 msgid "" "*\"Free Python Games are great because they really engage students and " "let them learn at their own pace.\"*" msgstr "" +"*\"Free Python Games é ótimo por envolver os alunos e permitir que " +"aprendam em seu próprio ritmo.\"*" #: ../../../README.rst:51 msgid "-- Rick Schertle, Teacher, Steindorf STEAM School" -msgstr "" +msgstr "-- Rick Schertle, professor da Steindorf STEAM School" #: ../../../README.rst:53 msgid "" "*\"Free Python Games combines play and learning in a flexible environment" " that reduces the stress of a difficult topic like programming.\"*" msgstr "" +"*\"Free Python Games combina brincadeira e aprendizagem em um ambiente flexível" +" que reduz o estresse de um tópico difícil como a programação.\"*" #: ../../../README.rst:56 msgid "-- Brett Bymaster, Youth Pastor, The River Church Community" -msgstr "" +msgstr "-- Brett Bymaster, Pastor de jovens, Comunidade da The River Church" #: ../../../README.rst:58 msgid "" "*\"Free Python Games is great for students, is highly organized and " "flexible, and seeks to unleash inquiry and understanding.\"*" msgstr "" +"*\"Free Python Games é ótimo para estudantes, é altamente organizado e " +"flexível e procura liberar a investigação e a compreensão.\"*" #: ../../../README.rst:61 msgid "-- Terri Furton, Principal, Downtown College Prep" -msgstr "" +msgstr "-- Terri Furton, Diretor da Downton College Prep" #: ../../../README.rst:65 msgid "Features" -msgstr "" +msgstr "Características" #: ../../../README.rst:67 msgid "Fun to play!" -msgstr "" +msgstr "Divertido de jogar" #: ../../../README.rst:68 msgid "Simple Python code" -msgstr "" +msgstr "Código de Python simples" #: ../../../README.rst:69 msgid "Easy to install" -msgstr "" +msgstr "Fácil de instalar" #: ../../../README.rst:70 msgid "Designed for education" -msgstr "" +msgstr "Projetado para educação" #: ../../../README.rst:71 msgid "Depends only on the Python Standard Library" -msgstr "" +msgstr "Depende apenas da biblioteca padrão de Python" #: ../../../README.rst:72 msgid "Used in hundreds of hours of classroom instruction" -msgstr "" +msgstr "Usado em centenas de horas de instrução em sala de aula" #: ../../../README.rst:73 msgid "Fully Documented" -msgstr "" +msgstr "Completamente documentado" #: ../../../README.rst:74 msgid "100% Test Coverage" -msgstr "" +msgstr "100% de cobertura de teste" #: ../../../README.rst:75 -msgid "Developed on Python 3.7" +msgid "Developed on Python 3.9" msgstr "" #: ../../../README.rst:76 -msgid "Tested on CPython 2.7, 3.4, 3.5, 3.6, and 3.7" +msgid "Tested on CPython 3.6, 3.7, 3.8, 3.9" msgstr "" #: ../../../README.rst:77 -msgid "Tested on Windows, Mac OS X, Raspbian (Raspberry Pi), and Linux" +msgid "Tested on Linux, Mac OS X, and Windows" msgstr "" #: ../../../README.rst:78 -msgid "Tested using Travis CI and AppVeyor CI" +msgid "Tested using GitHub Actions" msgstr "" -#: ../../../README.rst:88 +#: ../../../README.rst:85 msgid "Quickstart" -msgstr "" +msgstr "Começo rápido" -#: ../../../README.rst:90 +#: ../../../README.rst:87 msgid "" "Installing Free Python Games is simple with `pip " "`_::" msgstr "" +"Instalar o Free Python Games é simples com `pip:" +"`_::" -#: ../../../README.rst:95 +#: ../../../README.rst:92 msgid "" "Free Python Games supports a command-line interface (CLI). Help for the " "CLI is available using::" msgstr "" +"Free Python Games oferece suporte a uma interface de linha de comandos " +"(CLI - Command Line Interface). A ajuda para a CLI está disponível usando::" -#: ../../../README.rst:100 +#: ../../../README.rst:97 msgid "" "The CLI supports three commands: list, copy, and show. For a list of all " "games run::" msgstr "" +"A CLI suporta três comandos: list, copy e show. Para obter uma lista " +"de todos os jogos, execute::" -#: ../../../README.rst:105 +#: ../../../README.rst:102 msgid "" "Any of the listed games may be played by executing the Python module from" " the command-line. To reference the Python module, combine \"freegames\" " "with the name of the game. For example, to play the \"snake\" game run::" msgstr "" +"Qualquer um dos jogos listados pode ser jogado executando-se o módulo" +" Python na linha de comando. Para fazer referência ao módulo Python, " +"combine \"freegames\" com o nome do jogo. Por exemplo, para jogar o jogo \"snake\" execute::" -#: ../../../README.rst:111 +#: ../../../README.rst:108 msgid "" "Games can be modified by copying their source code. The copy command will" " create a Python file in your local directory which you can edit. For " "example, to copy and play the \"snake\" game run::" msgstr "" +"Os jogos podem ser modificados copiando-se seu código fonte. O comando copy" +" criará um arquivo Python, em seu diretório local, que você pode editar. " +"Por exemplo, para copiar e jogar o jogo \"snake\" execute::" -#: ../../../README.rst:118 +#: ../../../README.rst:115 msgid "" "Python includes a built-in text editor named IDLE which can also execute " "Python code. To launch the editor and make changes to the \"snake\" game " "run::" msgstr "" +"Python inclui um editor de texto integrado chamado IDLE, que também pode executar " +"código Python. Para iniciar o editor e fazer alterações no jogo \"snake\" execute::" -#: ../../../README.rst:123 +#: ../../../README.rst:120 msgid "" "You can also access documentation in the interpreter with Python's built-" "in help function::" msgstr "" +"Você também pode acessar a documentação no interpretador com a função " +"embutida no Python help::" -#: ../../../README.rst:131 + +#: ../../../README.rst:128 msgid "Free Games" -msgstr "" +msgstr "Jogos Livres" -#: ../../../README.rst:134 +#: ../../../README.rst:131 msgid "Paint" -msgstr "" +msgstr "Paint" -#: ../../../README.rst:136 +#: ../../../README.rst:133 msgid "" "`Paint`_ -- draw lines and shapes on the screen. Click to mark the start " "of a shape and click again to mark its end. Different shapes and colors " "can be selected using the keyboard." msgstr "" +"`Paint`_ -- desenhe linhas e formas na tela. Clique para marcar o início " +"e uma forma e clique novamente para marcar o seu final. Diferentes formas " +"e cores podem ser selecionadas usando o teclado." msgid "Paint Free Python Game" -msgstr "" +msgstr "Paint Free Python Game" -#: ../../../README.rst:146 +#: ../../../README.rst:143 msgid "Snake" -msgstr "" +msgstr "Snake" -#: ../../../README.rst:148 +#: ../../../README.rst:145 msgid "" "`Snake`_ -- classic arcade game. Use the arrow keys to navigate and eat " "the green food. Each time the food is consumed, the snake grows one " -"segment longer. Avoid eating yourself or going out of bounds!" +"segment longer. Avoid eating yourself or going out of bounds! (`OO " +"version`_)" msgstr "" +"`Snake`_ -- jogo de arcade clássico. Use as setas do teclado para navegar e comer " +"a comida verde. Cada vez que o alimento é consumido, a cobra cresce um " +"segmento a mais. Evite comer você mesmo ou bater nas bordas!" msgid "Snake Free Python Game" -msgstr "" +msgstr "Snake Free Python Game" -#: ../../../README.rst:158 +#: ../../../README.rst:156 msgid "Pacman" -msgstr "" +msgstr "Pacman" -#: ../../../README.rst:160 +#: ../../../README.rst:158 msgid "" "`Pacman`_ -- classic arcade game. Use the arrow keys to navigate and eat " "all the white food. Watch out for red ghosts that roam the maze." msgstr "" +"`Pacman`_ -- jogo de arcade clássico. Use as setas do teclado para navegar e comer " +"toda a comida branca. Cuidado com os fantasmas vermelhos que vagam pelo labirinto." msgid "Pacman Free Python Game" -msgstr "" +msgstr "Pacman Free Python Game" -#: ../../../README.rst:169 +#: ../../../README.rst:167 msgid "Cannon" -msgstr "" +msgstr "Canhão" -#: ../../../README.rst:171 +#: ../../../README.rst:169 msgid "" "`Cannon`_ -- projectile motion. Click the screen to fire your " "cannnonball. The cannonball pops blue balloons in its path. Pop all the " "balloons before they can cross the screen." msgstr "" +"`Canhão`_ -- movimento de projétil. Clique na tela para disparar sua bala de canhão." +"A bala de canhão estoura balões azuis em seu caminho. Estoure todos os balões " +"antes que eles possam cruzar a tela." msgid "Cannon Free Python Game" -msgstr "" +msgstr "Canhão Free Python Game" -#: ../../../README.rst:181 +#: ../../../README.rst:179 msgid "Connect" -msgstr "" +msgstr "Connect" -#: ../../../README.rst:183 +#: ../../../README.rst:181 msgid "" "`Connect`_ -- Connect 4 game. Click a row to drop a disc. The first " "player to connect four discs vertically, horizontally, or diagonally " "wins!" msgstr "" +"`Connect`_ -- Jogo Ligue 4. Clique em uma linha para soltar um disco. O primeiro" +"jogador a conectar quatro discos verticalmente, horizontalmente ou diagonalmente vence!" msgid "Connect 4 Free Python Game" -msgstr "" +msgstr "Connect 4 Free Python Game" -#: ../../../README.rst:192 +#: ../../../README.rst:190 msgid "Flappy" -msgstr "" +msgstr "Flappy" -#: ../../../README.rst:194 +#: ../../../README.rst:192 msgid "" "`Flappy`_ -- Flappy-bird inspired game. Click the screen to flap your " "wings. Watch out for black ravens as you fly across the screen." msgstr "" +"`Flappy`_ -- Jogo inspirado em Flappy-bird. Clique na tela para " +"bater suas asas. Cuidado com os corvos negros enquanto voa pela tela." msgid "Flappy Bird Free Python Game" -msgstr "" +msgstr "Flappy Bird Free Python Game" -#: ../../../README.rst:203 +#: ../../../README.rst:201 msgid "Memory" -msgstr "" +msgstr "Memória" -#: ../../../README.rst:205 +#: ../../../README.rst:203 msgid "" "`Memory`_ -- puzzle game of number pairs. Click a tile to reveal a " "number. Match two numbers and the tiles will disappear to reveal an " "image." msgstr "" +"`Memória`_ -- jogo de quebra-cabeça de pares de números. Clique em um ladrilho para " +"revelar um número. Combine dois números e as peças desaparecerão para revelar uma imagem." msgid "Memory Free Python Game" -msgstr "" +msgstr "Memória Free Python Game" -#: ../../../README.rst:214 +#: ../../../README.rst:212 msgid "Pong" -msgstr "" +msgstr "Pong" -#: ../../../README.rst:216 +#: ../../../README.rst:214 msgid "" "`Pong`_ -- classic arcade game. Use the keyboard to move your paddle up " "and down. The first player to miss the ball loses." msgstr "" +"`Pong`_ -- jogo de arcade clássico. Use o teclado para mover a raquete para " +"cima e para baixo. O primeiro jogador a perder a bola perde." msgid "Pong Free Python Game" -msgstr "" +msgstr "Pong Free Python Game" -#: ../../../README.rst:225 +#: ../../../README.rst:223 msgid "Simon Says" -msgstr "" +msgstr "Simon Says" -#: ../../../README.rst:227 +#: ../../../README.rst:225 msgid "" "`Simon Says`_ -- classic memory puzzle game. Click the screen to start. " "Watch the pattern and then click the tiles in the same order. Each time " "you get the sequence right the pattern gets one step longer." msgstr "" +"`Simon Says`_ -- jogo clássico de quebra-cabeça de memória. Clique na tela para começar." +"Observe o padrão e clique nas peças na mesma ordem. Cada vez que você acerta a sequência, " +"o padrão fica um passo mais longo." msgid "Simon Says Free Python Game" -msgstr "" +msgstr "Simon Says Free Python Game" -#: ../../../README.rst:237 +#: ../../../README.rst:235 msgid "Tic Tac Toe" -msgstr "" +msgstr "Jogo da Velha" -#: ../../../README.rst:239 +#: ../../../README.rst:237 msgid "" "`Tic Tac Toe`_ -- classic game. Click the screen to place an X or O. " "Connect three in a row and you win!" msgstr "" +"`Jogo da Velha`_ -- jogo clássico. Clique na tela para colocar um X ou O. " +"Conecte três em uma linha e você ganha!" msgid "Tic Tac Toe Free Python Game" -msgstr "" +msgstr "Jogo da Velha Free Python Game" -#: ../../../README.rst:248 +#: ../../../README.rst:246 msgid "Tiles" -msgstr "" +msgstr "Tiles" -#: ../../../README.rst:250 +#: ../../../README.rst:248 msgid "" "`Tiles`_ -- puzzle game of sliding numbers into place. Click a tile " "adjacent to the empty square to swap positions. Can you make the tiles " "count one to fifteen from left to right and bottom to top?" msgstr "" +"`Tiles`_ -- jogo de quebra-cabeça de números deslizantes. Clique em um ladrilho " +"adjacente ao quadrado vazio para trocar de posição. Você pode fazer as " +"peças contarem de um a quinze da esquerda para a direita e de baixo para cima?" msgid "Tiles Free Python Game" -msgstr "" +msgstr "Tiles Free Python Game" -#: ../../../README.rst:260 +#: ../../../README.rst:258 msgid "Tron" -msgstr "" +msgstr "Tron" -#: ../../../README.rst:262 +#: ../../../README.rst:260 msgid "" "`Tron`_ -- classic arcade game. Use the keyboard to change the direction " "of your Tron player. Avoid touching the line drawn by your opponent." msgstr "" +"`Tron`_ -- jogo clássico de arcade. Utilize o teclado para mudar a direção " +"do seu jogador em Tron. Evite tocar na linha desenhada pelo seu oponente." msgid "Tron Free Python Game" -msgstr "" +msgstr "Tron Free Python Game" -#: ../../../README.rst:271 +#: ../../../README.rst:269 msgid "Life" -msgstr "" +msgstr "Jogo da vida" -#: ../../../README.rst:273 +#: ../../../README.rst:271 msgid "" "`Life`_ -- Conway's Game of Life. The classic, zero-player, cellular " "automation created in 1970 by John Conway." msgstr "" +"`Life`_ -- Jogo da vida de Conway. A clássica automação celular, zero-player, " +"criada em 1970 por John Conway." msgid "Game of Life Free Python Game" -msgstr "" +msgstr "Jogo da Vida Free Python Game" -#: ../../../README.rst:282 +#: ../../../README.rst:280 msgid "Maze" -msgstr "" +msgstr "Maze" -#: ../../../README.rst:284 +#: ../../../README.rst:282 msgid "" "`Maze`_ -- move from one side to another. Inspired by `A Universe in One " "Line of Code with 10 PRINT`_. Tap the screen to trace a path from one " "side to another." msgstr "" +"`Maze`_ -- Mover de um lado para o outro. Inspirado por `A Universe in One " +"Line of Code with 10 PRINT`_. Toque na tela para traçar um caminho de um lado para o outro." msgid "Maze Free Python Game" -msgstr "" +msgstr "Maze Free Python Game" -#: ../../../README.rst:295 +#: ../../../README.rst:293 msgid "Fidget" -msgstr "" +msgstr "Fidget" -#: ../../../README.rst:297 +#: ../../../README.rst:295 msgid "" "`Fidget`_ -- fidget spinner inspired animation. Click the screen to " "accelerate the fidget spinner." msgstr "" +"`Fidget`_ -- Animação inspirada nos brinquedos fidget spinner. Clique " +"na tela para acelerar o fidget spinner." msgid "Fidget Spinner Free Python Game" -msgstr "" +msgstr "Fidget Free Python Game" -#: ../../../README.rst:307 +#: ../../../README.rst:305 msgid "User Guide" -msgstr "" +msgstr "Guia do Usuário" -#: ../../../README.rst:309 +#: ../../../README.rst:307 msgid "" "For those wanting more details, this part of the documentation describes " "curriculum, API, and development." msgstr "" +"Para aqueles que procuram mais detalhes, essa parte da documentação descreve " +"o currículo, API, e desenvolvimento." -#: ../../../README.rst:312 +#: ../../../README.rst:310 msgid "`Talk: Give the Gift of Python`_" -msgstr "" +msgstr "`Palestra: Dê o presente de Python`_" -#: ../../../README.rst:313 +#: ../../../README.rst:311 msgid "`Free Python Games Curriculum`_" -msgstr "" +msgstr "`Currículo Free Python Games`_" -#: ../../../README.rst:314 +#: ../../../README.rst:312 msgid "`Free Python Games API Reference`_" -msgstr "" +msgstr "`Referência da API do Free Python Games`_" -#: ../../../README.rst:315 +#: ../../../README.rst:313 msgid "`Free Python Games Development`_" -msgstr "" +msgstr "`Desenvolvimento do Free Python Games`_" -#: ../../../README.rst:324 +#: ../../../README.rst:322 msgid "References" -msgstr "" +msgstr "Referências" -#: ../../../README.rst:326 +#: ../../../README.rst:324 msgid "`Free Python Games Documentation`_" -msgstr "" +msgstr "`Documentação do Free Python Games`_ " -#: ../../../README.rst:327 +#: ../../../README.rst:325 msgid "`Free Python Games at PyPI`_" -msgstr "" +msgstr "`Free Python Games no PyPI`_" -#: ../../../README.rst:328 +#: ../../../README.rst:326 msgid "`Free Python Games at GitHub`_" -msgstr "" +msgstr "`Free Python Games no GitHub`_" -#: ../../../README.rst:329 +#: ../../../README.rst:327 msgid "`Free Python Games Issue Tracker`_" -msgstr "" +msgstr "`Rastreador de issues do Free Python Games`_" -#: ../../../README.rst:338 +#: ../../../README.rst:336 msgid "Free Python Games License" -msgstr "" +msgstr "Licença do Free Python Games" -#: ../../../README.rst:340 -msgid "Copyright 2017-2020 Grant Jenks" -msgstr "" +#: ../../../README.rst:338 +msgid "Copyright 2017-2021 Grant Jenks" +msgstr "Direitos autorais 2017-2021 Grant Jenks" -#: ../../../README.rst:342 +#: ../../../README.rst:340 msgid "" "Licensed under the Apache License, Version 2.0 (the \"License\"); you may" " not use this file except in compliance with the License. You may obtain" " a copy of the License at" msgstr "" +"Licenciado pela licença Apache, Versão 2.0( A \"Licença\"); Você não pode usar" +" esse documento exceto se estiver em concordância com a Licença. Pode obter a" +" cópia da licença em" -#: ../../../README.rst:346 +#: ../../../README.rst:344 msgid "http://www.apache.org/licenses/LICENSE-2.0" -msgstr "" +msgstr "http://www.apache.org/licenses/LICENSE-2.0" -#: ../../../README.rst:348 +#: ../../../README.rst:346 msgid "" "Unless required by applicable law or agreed to in writing, software " "distributed under the License is distributed on an \"AS IS\" BASIS, " @@ -504,4 +600,32 @@ msgid "" " See the License for the specific language governing permissions and " "limitations under the License." msgstr "" +"A menos que exigido pela lei aplicável ou acordado por escrito, o software " +"distribuído sob a Licença é distribuído \"COMO ESTÁ\", SEM GARANTÍAS OU CONDIÇÕES DE " +"QUALQUER TIPO, expressas ou implícitas. Consulte a licença para as permissões e" +"limitações que regem o idioma específico sob a Licença." + +#~ msgid "Developed on Python 3.7" +#~ msgstr "" + +#~ msgid "Tested on CPython 2.7, 3.4, 3.5, 3.6, and 3.7" +#~ msgstr "" + +#~ msgid "Tested on Windows, Mac OS X, Raspbian (Raspberry Pi), and Linux" +#~ msgstr "" + +#~ msgid "Tested using Travis CI and AppVeyor CI" +#~ msgstr "" + +#~ msgid "" +#~ "`Snake`_ -- classic arcade game. Use " +#~ "the arrow keys to navigate and eat" +#~ " the green food. Each time the " +#~ "food is consumed, the snake grows " +#~ "one segment longer. Avoid eating " +#~ "yourself or going out of bounds!" +#~ msgstr "" + +#~ msgid "Copyright 2017-2020 Grant Jenks" +#~ msgstr "" diff --git a/docs/locale/pt_BR/LC_MESSAGES/madlibs.po b/docs/locale/pt_BR/LC_MESSAGES/madlibs.po new file mode 100644 index 00000000..89957903 --- /dev/null +++ b/docs/locale/pt_BR/LC_MESSAGES/madlibs.po @@ -0,0 +1,28 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) 2017-2021, Grant Jenks +# This file is distributed under the same license as the Free Python Games +# package. +# FIRST AUTHOR , 2021. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Free Python Games 2.3.2\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-10-04 21:57-0300\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=utf-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Generated-By: Babel 2.9.1\n" + +#: ../../madlibs.rst:2 +msgid "Mad Libs" +msgstr "" + +#: ../../madlibs.rst:4 +msgid "Create a funny story from a not-so funny story" +msgstr "" + diff --git a/docs/locale/pt_BR/LC_MESSAGES/sphinx.po b/docs/locale/pt_BR/LC_MESSAGES/sphinx.po index fc9b7ced..9d5205c8 100644 --- a/docs/locale/pt_BR/LC_MESSAGES/sphinx.po +++ b/docs/locale/pt_BR/LC_MESSAGES/sphinx.po @@ -4,37 +4,37 @@ # package. # FIRST AUTHOR , 2021. # -#, fuzzy msgid "" msgstr "" "Project-Id-Version: Free Python Games 2.3.2\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-08-24 21:25-0300\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" +"PO-Revision-Date: 2021-10-21 08:45-0300\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "Generated-By: Babel 2.9.1\n" +"Last-Translator: Pedro Henrique de Brito Gomes \n" +"Language-Team: \n" +"Language: pt_BR\n" +"X-Generator: Poedit 2.3\n" #: ../../_templates/gumroad.html:1 msgid "Donate" -msgstr "" +msgstr "Doações" #: ../../_templates/gumroad.html:2 msgid "If you or your organization uses Free Games, consider donating:" -msgstr "" +msgstr "Se você ou sua organização usa Free Games, considere fazer uma doação:" #: ../../_templates/gumroad.html:4 msgid "Donate to Free Python Games" -msgstr "" +msgstr "Doe para Free Python games" #: ../../_templates/pagetoc.html:11 msgid "Contents" -msgstr "" +msgstr "Conteúdo" #: ../../_templates/search.html:14 ../../_templates/search.html:17 msgid "Search" -msgstr "" - +msgstr "Busca" diff --git a/docs/pacman_oop.rst b/docs/pacman_oop.rst new file mode 100644 index 00000000..de3fbc06 --- /dev/null +++ b/docs/pacman_oop.rst @@ -0,0 +1,6 @@ +Pacman +====== + +Pacman, classic arcade game. + +.. literalinclude:: ../freegames/pacman_oop.py diff --git a/docs/snake_oop.rst b/docs/snake_oop.rst new file mode 100644 index 00000000..cec22a75 --- /dev/null +++ b/docs/snake_oop.rst @@ -0,0 +1,6 @@ +Snake +===== + +Snake, classic arcade game. + +.. literalinclude:: ../freegames/snake_oop.py diff --git a/freegames/oop/snake_oop.py b/freegames/oop/snake_oop.py new file mode 100644 index 00000000..b4067b4a --- /dev/null +++ b/freegames/oop/snake_oop.py @@ -0,0 +1,197 @@ +"""Snake, classic arcade game. + +Exercises + +1. How do you make the SnakeFast or SnakeSlow classes? +2. How do you make a SnakeSmart, that change the direction when collide with edges? +3. How would you make a new food types? When snake eat them it will more fast or decrease? +4. How do you create a Actor that will be the Head and Food superclass? +""" + +from turtle import setup, hideturtle, tracer, listen, onkey, done, update, clear, ontimer +from random import randrange, choice +from freegames import square, vector + +class Head: + def __init__(self, x, y): + self.position = vector(x, y) + + @property + def x(self): + return self.position.x + + @property + def y(self): + return self.position.y + +class Food: + color = 'Blue' + cal = 1 + def __init__(self, x, y): + self.position = vector(x, y) + + @property + def x(self): + return self.position.x + + @property + def y(self): + return self.position.y + +class Snake: + SPEED = 1 + def __init__(self, x=0, y=0): + self.head = Head(x, y) + self.body = [vector(10, 0)] + self.aim = vector(0*self.SPEED, -10*self.SPEED) + self.direction = "SOUTH" + self.status = 'LIVE' + + def eat(self, food): + print('snake is eating', food.cal) + for x in range(food.cal): + self.body.append(self.head.position) + + for x in range(food.cal, 0): + del self.body[0] + + def move(self): + "Move snake forward one segment." + self.head = Head(*self.body[-1].copy()) + self.head.position.move(self.aim) + + if self.is_colliding_with_border(): + self.on_collision_with_border() + elif self.is_eating_himself(): + self.on_eating_himself() + else: + self.body.append(self.head.position) + self.body.pop(0) # cut the tail + + def on_collision_with_border(self): + self.dead() + + def on_eating_himself(self): + self.dead() + + def is_eating_himself(self): + return (self.head.position in self.body) + + def dead(self): + self.status = 'DEAD' + + def alive(self): + return self.status != 'DEAD' + + def is_colliding_with_border(self): + return not(-200 < self.head.x < 190 and -200 < self.head.y < 190) + + def left(self): + if self.direction == "NORTH" : + self.aim.x = -10*self.SPEED + self.aim.y = 0*self.SPEED + + elif self.direction == "SOUTH": + self.aim.x = 10*self.SPEED + self.aim.y = 0*self.SPEED + + elif self.direction == "WEST" : + self.aim.x = 0*self.SPEED + self.aim.y = -10*self.SPEED + + elif self.direction == "EAST": + self.aim.x = 0*self.SPEED + self.aim.y = 10*self.SPEED + + def right(self): + if self.direction == "NORTH" : + self.aim.x = 10*self.SPEED + self.aim.y = 0*self.SPEED + + elif self.direction == "SOUTH": + self.aim.x = -10*self.SPEED + self.aim.y = 0*self.SPEED + + elif self.direction == "WEST" : + self.aim.x = 0*self.SPEED + self.aim.y = 10*self.SPEED + + elif self.direction == "EAST": + self.aim.x = 0*self.SPEED + self.aim.y = -10*self.SPEED + +class GameSnake: + def __init__(self): + self.food = self.new_food() + self.snake = Snake() + + onkey(lambda: self.on_rightkeypressed() , 'Right') + onkey(lambda: self.on_leftkeypressed(), 'Left') + onkey(lambda: self.on_upkeypressed(), 'Up') + onkey(lambda: self.on_downkeypressed(), 'Down') + + def on_rightkeypressed(self): + if self.snake.direction == 'NORTH': + self.snake.right() + elif self.snake.direction == "SOUTH": + self.snake.left() + self.snake.direction = "EAST" + + def on_leftkeypressed(self): + if self.snake.direction == 'NORTH': + self.snake.left() + elif self.snake.direction == "SOUTH": + self.snake.right() + self.snake.direction = "WEST" + + def on_upkeypressed(self): + if self.snake.direction == 'WEST': + self.snake.right() + elif self.snake.direction == "EAST": + self.snake.left() + self.snake.direction = "NORTH" + + def on_downkeypressed (self): + if self.snake.direction == 'WEST': + self.snake.left() + elif self.snake.direction == "EAST": + self.snake.right() + self.snake.direction = "SOUTH" + + def new_food(self): + foods = [Food] + type_food = choice(foods) + food = type_food(0, 0) + food.position = vector(randrange(-15, 15) * 10, randrange(-15, 15) * 10) + return food + + def run(self): + clear() + for body in self.snake.body: + square(body.x, body.y, 9, 'black') + square(self.food.x, self.food.y, 9, self.food.color) + update() + self.snake.move() + + if self.snake.head.position == self.food.position: + self.snake.eat(self.food) + self.food = self.new_food() + + if self.snake.alive(): + ontimer(self.run, 100) + else: + print('>>> SNAKE IS DEAD <<<') + square(self.snake.head.x, self.snake.head.y, 9, 'red') + return + +def init(): + setup(420, 420, 370, 0) + hideturtle() + tracer(False) + listen() + game = GameSnake() + game.run() + done() + +if __name__ == '__main__': + init() \ No newline at end of file diff --git a/freegames/pacman_oop.py b/freegames/pacman_oop.py index a061fc6d..0d3032fa 100644 --- a/freegames/pacman_oop.py +++ b/freegames/pacman_oop.py @@ -2,11 +2,13 @@ Exercises -1. Move the score variable/attribute to Pacman's class. This attribute must be incremented by a new method in Pacman's code. - Chose draw_score according to the needed changes in GamePacman. -2. Create a speed attribute and do the needed changes to change Pacman's speed according to its value. -3. Create a subclass of Ghosts that each one of them has ghosts - with different speeds value (Use the second exercise as an example). +1. Move the score variable/attribute to Pacman's class. This attribute must be +incremented by a new method in Pacman's code. Chose draw_score according to the +needed changes in GamePacman. +2. Create a speed attribute and do the needed changes to change Pacman's speed +according to its value. +3. Create a subclass of Ghosts that each one of them has ghosts with different +speeds value (Use the second exercise as an example). 4. Create a superclass for both Pacman and Ghost. 5. Create different types of food. @@ -16,19 +18,16 @@ from turtle import bgcolor, clear, up, down, goto, Turtle, dot, update, ontimer, setup, hideturtle, tracer, listen, onkey, done from freegames import floor, vector + class Pacman: - def __init__(self,position_x, position_y,aim_x,aim_y): - self.position = vector(position_x,position_y) + def __init__(self, position_x, position_y, aim_x, aim_y): + self.position = vector(position_x, position_y) self.aim = vector(aim_x, aim_y) self.direction = "EAST" self.state = "ALIVE" - self.score = 0 def move(self): - self.position.move(self.aim ) - - def eat(self): - self.score += 1 + self.position.move(self.aim) def die(self): self.state = "DEAD" @@ -37,26 +36,26 @@ def alive(self): return self.state != "DEAD" def next_position(self, aim=None): - if aim != None : + if aim != None: new_position = self.position + aim else: new_position = self.position + self.aim return new_position turn_to_left = {'NORTH': ('WEST', vector(-5, 0)), - 'WEST' : ('SOUTH', vector(0, -5)), - 'SOUTH': ('EAST', vector(5, 0)), - 'EAST' : ('NORTH', vector(0, 5))} + 'WEST': ('SOUTH', vector(0, -5)), + 'SOUTH': ('EAST', vector(5, 0)), + 'EAST': ('NORTH', vector(0, 5))} turn_to_right = {'NORTH': ('EAST', vector(5, 0)), - 'EAST' : ('SOUTH', vector(0, -5)), - 'SOUTH': ('WEST', vector(-5, 0)), - 'WEST' : ('NORTH', vector(0, 5))} + 'EAST': ('SOUTH', vector(0, -5)), + 'SOUTH': ('WEST', vector(-5, 0)), + 'WEST': ('NORTH', vector(0, 5))} turn_to_around = {'NORTH': ('SOUTH', vector(0, -5)), - 'SOUTH' : ('NORTH', vector(0, 5)), - 'WEST': ('EAST', vector(5, 0)), - 'EAST' : ('WEST', vector(-5, 0))} + 'SOUTH': ('NORTH', vector(0, 5)), + 'WEST': ('EAST', vector(5, 0)), + 'EAST': ('WEST', vector(-5, 0))} def left(self): self.direction, new_aim = self.turn_to_left[self.direction] @@ -70,13 +69,14 @@ def turn_around(self): self.direction, new_aim = self.turn_to_around[self.direction] self.aim = new_aim + class Ghost: - def __init__(self,position_x, position_y,aim_x,aim_y): - self.position = vector(position_x,position_y) + def __init__(self, position_x, position_y, aim_x, aim_y): + self.position = vector(position_x, position_y) self.aim = vector(aim_x, aim_y) def move(self): - self.position.move(self.aim ) + self.position.move(self.aim) def change_direction(self): options = [ @@ -87,46 +87,48 @@ def change_direction(self): ] self.aim = choice(options) + class GamePacman: def __init__(self): + self.state = {'score': 0} self.path = Turtle(visible=False) self.writer = Turtle(visible=False) self.pacman = Pacman(-40, -80, 5, 0) - self.ghosts = [Ghost(-180,160,5,0), - Ghost(-180,-160,0,5), - Ghost(100,160,0,-5), - Ghost(100,-160,-5,0)] + self.ghosts = [Ghost(-180, 160, 5, 0), + Ghost(-180, -160, 0, 5), + Ghost(100, 160, 0, -5), + Ghost(100, -160, -5, 0)] self.tiles = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, - 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, - 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, + 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ] self.draw_world() - onkey(lambda: self.on_rightkeypressed() , 'Right') + onkey(lambda: self.on_rightkeypressed(), 'Right') onkey(lambda: self.on_leftkeypressed(), 'Left') onkey(lambda: self.on_upkeypressed(), 'Up') onkey(lambda: self.on_downkeypressed(), 'Down') def on_rightkeypressed(self): - if self.valid(self.pacman.next_position(vector(5,0))): + if self.valid(self.pacman.next_position(vector(5, 0))): if self.pacman.direction == 'NORTH': self.pacman.right() elif self.pacman.direction == "SOUTH": @@ -135,7 +137,7 @@ def on_rightkeypressed(self): self.pacman.turn_around() def on_leftkeypressed(self): - if self.valid(self.pacman.next_position (vector(-5,0))): + if self.valid(self.pacman.next_position(vector(-5, 0))): if self.pacman.direction == 'NORTH': self.pacman.left() elif self.pacman.direction == "SOUTH": @@ -144,7 +146,7 @@ def on_leftkeypressed(self): self.pacman.turn_around() def on_upkeypressed(self): - if self.valid(self.pacman.next_position(vector(0,5))): + if self.valid(self.pacman.next_position(vector(0, 5))): if self.pacman.direction == 'WEST': self.pacman.right() elif self.pacman.direction == "EAST": @@ -152,8 +154,8 @@ def on_upkeypressed(self): elif self.pacman.direction == "SOUTH": self.pacman.turn_around() - def on_downkeypressed (self): - if self.valid(self.pacman.next_position(vector(0,-5))): + def on_downkeypressed(self): + if self.valid(self.pacman.next_position(vector(0, -5))): if self.pacman.direction == 'WEST': self.pacman.left() elif self.pacman.direction == "EAST": @@ -161,25 +163,25 @@ def on_downkeypressed (self): elif self.pacman.direction == "NORTH": self.pacman.turn_around() - def square(self,x,y): + def square(self, x, y): self.path.up() - self.path.goto(x,y) + self.path.goto(x, y) self.path.down() self.path.begin_fill() for count in range(4): self.path.forward(20) self.path.left(90) - + self.path.end_fill() - def offset(self,point): + def offset(self, point): x = (floor(point.x, 20) + 200) / 20 y = (180 - floor(point.y, 20)) / 20 index = int(x + y * 20) return index - def valid(self,point): + def valid(self, point): "Return True if point is valid in tiles." index = self.offset(point) @@ -199,10 +201,10 @@ def draw_world(self): for index in range(len(self.tiles)): tile = self.tiles[index] - if tile> 0: + if tile > 0: x = (index % 20) * 20 - 200 y = 180 - (index // 20) * 20 - self.square(x,y) + self.square(x, y) if tile == 1: self.path.up() @@ -215,21 +217,21 @@ def draw_score(self): self.writer.clear() self.writer.write('score: ') self.writer.goto(175, 160) - self.writer.write(self.pacman.score) + self.writer.write(self.state['score']) - def clear_tile(self,index): - self.tiles[index] = 2 - x = (index % 20) * 20 - 200 - y = 180 - (index // 20) * 20 - self.square(x, y) + def clear_tile(self, index): + self.tiles[index] = 2 + x = (index % 20) * 20 - 200 + y = 180 - (index // 20) * 20 + self.square(x, y) def move_and_draw_pacman(self): if self.valid(self.pacman.next_position()): self.pacman.move() up() - goto(self.pacman.position.x +10 , self.pacman.position.y + 10) - dot(20,'yellow') + goto(self.pacman.position.x + 10, self.pacman.position.y + 10) + dot(20, 'yellow') def move_and_draw_ghost(self): for ghost in self.ghosts: @@ -247,11 +249,11 @@ def check_collision(self): if abs(self.pacman.position - ghost.position) < 20: self.pacman.die() - index = self.offset(self.pacman.position ) + index = self.offset(self.pacman.position) if self.tiles[index] == 1: - self.pacman.eat() + self.state['score'] += 1 self.clear_tile(index) - + def run(self): self.writer.undo() self.draw_score() @@ -267,6 +269,7 @@ def run(self): update() + def init(): setup(420, 420, 370, 0) hideturtle() @@ -276,5 +279,6 @@ def init(): game.run() done() + if __name__ == '__main__': init() diff --git a/freegames/snake.py b/freegames/snake.py index 8bf5a52f..245b2522 100644 --- a/freegames/snake.py +++ b/freegames/snake.py @@ -7,6 +7,10 @@ 3. How would you move the food? 4. Change the snake to respond to mouse clicks. +1. Como você deixa a cobra mais rápida ou mais lenta? FEITO +2. Como você pode fazer a cobra contornar as bordas? +3. Como você moveria a comida? +4. Mude a cobra para responder às teclas de seta FEITO """ from random import randrange @@ -14,46 +18,47 @@ from freegames import square, vector -food = vector(0, 0) -snake = [vector(10, 0)] -aim = vector(0, -10) +food = vector(0, 0) #posição inicial da comida +snake = [vector(10, 0)]#posição inicial da cobra +aim = vector(0,-10) # velocidade/direção da cobra + def change(x, y): - "Change snake direction." + "Change snake direction."#"Mudar a direção da cobra." aim.x = x aim.y = y def inside(head): - "Return True if head inside boundaries." + "Return True if head inside boundaries."#"Retorne True se a cabeça estiver dentro dos limites." return -200 < head.x < 190 and -200 < head.y < 190 def move(): - "Move snake forward one segment." + "Move snake forward one segment." #Mova a cobra um segmento para frente head = snake[-1].copy() head.move(aim) - if not inside(head) or head in snake: - square(head.x, head.y, 9, 'red') + if not inside(head) or head in snake: # caso a cobra encoste nas bordas + square(head.x, head.y, 9, 'red')# desenha um dradrado vermelho update() return - snake.append(head) + snake.append(head) #adiciona um quadrado na direção aim no vetor snake if head == food: print('Snake:', len(snake)) - food.x = randrange(-15, 15) * 10 - food.y = randrange(-15, 15) * 10 + food.x = randrange(-15, 15) * 10 #novo X da comida no intervalo determinado + food.y = randrange(-15, 15) * 10 #novo Y da comida no intervalo determinado else: - snake.pop(0) + snake.pop(0) # remove o quadrado da posição anterior do vetor snake clear() - + #tamanho do corpo da cobra em relação ao vetor snake for body in snake: square(body.x, body.y, 9, 'black') - + #tamanho da comida square(food.x, food.y, 9, 'green') update() ontimer(move, 100) @@ -68,4 +73,4 @@ def move(): onkey(lambda: change(0, 10), 'Up') onkey(lambda: change(0, -10), 'Down') move() -done() +done() \ No newline at end of file