Giter VIP home page Giter VIP logo

games's Introduction


docs PyPI - Python Version PyPI license PyPI - Downloads PyPI - Downloads issue resolution open issues

Documents: http://cpgames.readthedocs.io/

Games

Create interesting games in pure python.
You can star this repository to keep track of the project if it's helpful for you, thank you for your support.

Statement

Most of the game materals(including music, fonts and pictures) in this repository are collected from the web, copyright belongs to the original author.
This repository is created just for learning python(Commercial prohibition).

Support List

ID English Name Chinese Name Core Code Introduction
Game1 bunnybadger 兔子和獾(射击游戏) click click
Game2 voicecontrolpikachu 仿八分音符的声控小游戏 click click
Game3 puzzlepieces 拼图小游戏 click click
Game4 ski 滑雪游戏 click click
Game5 tankwar 经典坦克大战小游戏 click click
Game6 flappybird 飞扬的小鸟小游戏 click click
Game7 trexrush 仿谷歌浏览器小恐龙游戏 click click
Game8 towerdefense 塔防游戏 click click
Game9 catchcoins 接金币小游戏 click click
Game10 aircraftwar 飞机大战 click click
Game11 tetris 俄罗斯方块 click click
Game12 sokoban 推箱子 click click
Game13 alieninvasion 外星人入侵小游戏 click click
Game14 pacman 吃豆人小游戏 click click
Game15 gemgem 消消乐 click click
Game16 twentyfourpoint 24点小游戏 click click
Game17 pingpong 乒乓球小游戏 click click
Game18 breakoutclone 打砖块小游戏 click click
Game19 bomberman 炸弹人小游戏 click click
Game20 maze 走迷宫小游戏 click click
Game21 whacamole 打地鼠 click click
Game22 gobang 五子棋小游戏 click click
Game23 twozerofoureight 2048小游戏 click click
Game24 greedysnake 贪吃蛇小游戏 click click
Game25 minesweeper 扫雷小游戏 click click
Game26 angrybirds 愤怒的小鸟 click click
Game27 flipcardbymemory 记忆翻牌小游戏 click click
Game28 magictower 魔塔小游戏 click click
Game29 bloodfootball 热血足球小游戏 click click

Install

Whl install

wget https://github.com/CharlesPikachu/Games/releases/download/v0.1.2/cpgames-0.1.2-py3-none-any.whl
pip install cpgames-0.1.2-py3-none-any.whl

Pip install

run "pip install cpgames"

Source code install

(1) Offline
Step1: git clone https://github.com/CharlesPikachu/Games.git
Step2: cd Games -> run "python setup.py install"
(2) Online
run "pip install git+https://github.com/CharlesPikachu/Games.git@master"

Quick Start

import random
from cpgames import cpgames

game_client = cpgames.CPGames()
all_supports = game_client.getallsupported()
game_client.execute(random.choice(list(all_supports.values())))

Screenshot

img

Projects in Charles_pikachu

  • Games: Create interesting games in pure python.
  • DecryptLogin: APIs for loginning some websites by using requests.
  • Musicdl: A lightweight music downloader written in pure python.
  • Videodl: A lightweight video downloader written in pure python.
  • Pytools: Some useful tools written in pure python.
  • PikachuWeChat: Play WeChat with itchat-uos.
  • Pydrawing: Beautify your image or video.
  • ImageCompressor: Image compressors written in pure python.
  • FreeProxy: Collecting free proxies from internet.
  • Paperdl: Search and download paper from specific websites.
  • Sciogovterminal: Browse "The State Council Information Office of the People's Republic of China" in the terminal.
  • CodeFree: Make no code a reality.
  • DeepLearningToys: Some deep learning toys implemented in pytorch.
  • DataAnalysis: Some data analysis projects in charles_pikachu.
  • Imagedl: Search and download images from specific websites.
  • Pytoydl: A toy deep learning framework built upon numpy.
  • NovelDL: Search and download novels from some specific websites.

Citation

If you use this project in your research, please cite this project.

@misc{games2020,
    author = {Zhenchao Jin},
    title = {Games: Create interesting games in pure python},
    year = {2020},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/CharlesPikachu/Games}},
}

More

WeChat Official Accounts

Charles_pikachu
img

games's People

Contributors

charlespikachu 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  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

games's Issues

hello, I want to contribute this game.

Hello? I am first time in git-hub, so if I rude tell me please... Anyway... I interested in game, and python. I want to contribute this project. I can translate annotate to English,Korean.
And We can exchange Idea... And I can add more contents to Readme.md. And I can also use Python.(I am studying now...very diligently)... so can I contribute this project? If you tell me what kind of help do you need, I will help you.

mixer module not available (ModuleNotFoundError: No module named 'pygame.mixer')

一直报错找不到mixer这个module,我用的是Mac,需要额外安装mixer吗
Hello from the pygame community. https://www.pygame.org/contribute.html
/Users/yangzho2/Downloads/Games-master/Game12/Game12.py:283: RuntimeWarning: use mixer: No module named 'pygame.mixer'
(ModuleNotFoundError: No module named 'pygame.mixer')
pygame.mixer.init()
Traceback (most recent call last):
File "/Users/yangzho2/Downloads/Games-master/Game12/Game12.py", line 301, in
main()
File "/Users/yangzho2/Downloads/Games-master/Game12/Game12.py", line 283, in main
pygame.mixer.init()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/pygame/init.py", line 100, in getattr
raise NotImplementedError(missing_msg)
NotImplementedError: mixer module not available (ModuleNotFoundError: No module named 'pygame.mixer')

[BUG]

Environment (使用环境)

  • Installation method (安装方式):
  • The version of cpgames (版本号):
  • Operating system (操作系统):
  • Python version (Python版本):

Question description (问题描述)

Screenshot (报错截图)
image

Advice (修复建议)

[BUG]

Environment (使用环境)

  • Installation method (安装方式):
  • The version of cpgames (版本号):
  • Operating system (操作系统):
  • Python version (Python版本):

Question description (问题描述)

Screenshot (报错截图)

Advice (修复建议)

Game2 AttributeError

AttributeError: module 'cocos' has no attribute 'layer'

要加一行import cocos.layer
估计是版本问题

缺少库pygame

运行之后
Traceback (most recent call last):
File "Game1.py", line 11, in
import pygame
ModuleNotFoundError: No module named 'pygame'

Importing Levels

Hi..
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "c:/Users/arvin/Desktop/Pacman/game.py", line 181, in
main(initialize())
File "c:/Users/arvin/Desktop/Pacman/game.py", line 164, in main
pygame.mixer.music.load(BGMPATH)
pygame.error: Failed loading libmpg123.dll: Attempt to access invalid address.

[BUG]

Environment (使用环境)

  • Installation method (安装方式):
  • The version of cpgames (版本号):
  • Operating system (操作系统):
  • Python version (Python版本):

Question description (问题描述)

Screenshot (报错截图)

Advice (修复建议)

[求助]Game19 运行后没有画面

初次运行游戏程序。

git clone 文件夹之后,运行 PyGame19。

  • macOS 10.14.6
  • PyGame 1.9.9
  • Python 3.7.3

image

可以听到音乐但是无法看到画面,不知道哪里出现问题。

image

Music credits

Didn’t find the music’s credits anywhere… I had to google the lyrics ! lol
Thanks much for your open-source repository, it’s very fun and educational to look around !

[BUG]

Environment (使用环境)

  • Installation method (安装方式):
  • The version of cpgames (版本号):
  • Operating system (操作系统):
  • Python version (Python版本):

Question description (问题描述)

Screenshot (报错截图)

Advice (修复建议)

Game 1

Hello,

I'm really bad at your game. That being said, I enjoyed it. Although it might be better to start off with one or two otters(?) first, and then gradually increase the amount of opponents as well as their speed of approach. Additionally, having an option to restart the game would be helpful. Regardless, it's pretty fun!

怎样改变射击速度?

(original)
if event.type == pygame.MOUSEBUTTONDOWN:
my_bullet = myaircraft.shot()
if my_bullet:
my_bullets_group.add(my_bullet)
(change)
#if event.type == pygame.MOUSEBUTTONDOWN:
my_bullet = myaircraft.shot()
if my_bullet:
my_bullets_group.add(my_bullet)

我从鼠标的点击中删除了子弹,从而改变了我的目标。 我想加快我的拍摄速度,但是我该怎么办呢?

I deleted the shot from the click of the mouse and changed it so that I could shoot while I was still. I want to speed up my shooting, but what code should I change?

导包的相对路径一直报错,怎么解决呢

Traceback (most recent call last):
File "D:/PythonWorkspace/games/Games/cpgames/core/games/bunnybadger/bunnybadger.py", line 16, in
from ...utils import QuitGame
ValueError: attempted relative import beyond top-level package

a bug with game8

After selling a tower,'money' changed from type int into type float.
And the program runs much more slowly on my old laptop,due to the CPU.
(Another plane game runs normally. )

卖塔以后钱从整型变成浮点型了
程序在我这个老笔记本上跑的很慢,因为CPU的关系.
(另一个自制的打飞机运行得就还可以)

游戏5有个疑问

提示这个错误是什么鬼
pygame.error: Unable to open file './audios/add.wav'

Game 2 pyaudio error

I got the following error on python3.6.8 running game 2:
Traceback (most recent call last):
File "Game2.py", line 75, in
cocos.director.director.init(caption="Pikachu Go Go Go")
File "C:\Users\mik\AppData\Local\Programs\Python\Python36\lib\site-packages\cocos\director.py", line 356, in init
cocos.audio.initialize(audio_settings)
File "C:\Users\mik\AppData\Local\Programs\Python\Python36\lib\site-packages\cocos\audio_init_.py", line 58, in initialize
music.set_control('dummy')
I asked around and someone said the audio needs to be initialized and gave the docs: http://python.cocos2d.org/doc/api/cocos.director.html#cocos.director.Director.init .
I'm a beginner to cocos so I don't know how to fix this. Help please.

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.