项目作者: yoyoberenguer

项目描述 :
cluster bomb
高级语言: Python
项目地址: git://github.com/yoyoberenguer/GameEffect-cluster-bomb.git
创建时间: 2019-05-10T07:27:26Z
项目社区:https://github.com/yoyoberenguer/GameEffect-cluster-bomb

开源协议:MIT License

下载


2D video Game Effect - cluster bomb



Add explosions effect to your video game using the source code provided into this git page

Please have also a look at the cython version to explore the same algorithm improved with
cython (FPS > 300)

New release

  1. click to the new version to download the demo
  2. Install the program using Setup_ClusterBomb.exe

KEYS

  1. spacebar : drop cluster bomb
  2. up : spaceship move up
  3. down : spaceship move down
  4. right : spaceship move right
  5. left : move left
  6. esc : quit

Python version

  1. Run the program ClusterBomb.py in your favorite python IDE
  2. Requirement:
  3. - Numpy
  4. - Python 3
  5. - Pygame
  6. C:\>pip install pygame==2.0, numpy==1.19.3

Cython version x10 faster

Two tests version :

1) ClusterMain_Collision.py
This version include lines of code to detect collision with background
layer (or object(s) belonging to a specific layer).
The cluster bomb will explose only if it touch a solid ground (specific layer
collision detection).

2) ClusterMain_NoCollision.py
Version without background collision detection, bombs explose regardless of the
background image (fastest version).
Bombs and background can be converted for fast blit (FPS over 100FPS).

Requirment :

  1. C:\>pip install cython, matplotlib, pygame==2.0, numpy==1.19.3
  2. - python > 3.0
  3. - numpy==1.19.3
  4. - pygame
  5. - Cython
  6. - A C compiler for windows (Visual Studio, MinGW etc) install on your system
  7. and linked to your windows environment.
  8. Note that some adjustment might be needed once a compiler is install on your system,
  9. refer to external documentation or tutorial in order to setup this process.
  10. e.g https://devblogs.microsoft.com/python/unable-to-find-vcvarsall-bat/

Compilation :

  1. In a command prompt and under the directory containing the source files
  2. C:\>python setup_Project.py build_ext --inplace
  3. If the compilation fail, refers to the requirement section and make sure cython
  4. and a C-compiler are correctly install on your system.

alt text
alt text
alt text