• 大小: 32.45M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-01-30
  • 语言: Python
  • 标签: 贪吃蛇  

资源简介


资源截图

代码片段和文件信息

import cocos
from cocos.director import director

import define
from snake import Snake
from dot import Dot

class Arena(cocos.layer.Colorlayer):
    is_event_handler = True

    def __init__(self):
        super(Arena self).__init__(250 255 255 255 define.WIDTH define.HEIGHT)
        self.center = (director.get_window_size()[0] / 2 director.get_window_size()[1] / 2)
        self.batch = cocos.batch.BatchNode()
        self.add(self.batch)

        self.snake = Snake()
        self.add(self.snake 10000)
        self.snake.init_body()

        self.enemies = []
        for i in range(7):
            self.add_enemy()

        self.keys_pressed = set()

        for i in range(50):
            self.batch.add(Dot())

        self.schedule(self.update)

    def add_enemy(self):
        e

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件        1052  2017-03-01 06:54  gluttonous-master\.gitignore
     目录           0  2018-05-29 22:30  gluttonous-master\__pycache__\
     文件        2024  2018-05-29 22:30  gluttonous-master\__pycache__\arena.cpython-34.pyc
     文件        1046  2018-05-29 22:30  gluttonous-master\__pycache__\define.cpython-34.pyc
     文件        2044  2018-05-29 22:30  gluttonous-master\__pycache__\dot.cpython-34.pyc
     文件        1211  2018-05-29 22:30  gluttonous-master\__pycache__\gameover.cpython-34.pyc
     文件        6046  2018-05-29 22:30  gluttonous-master\__pycache__\snake.cpython-34.pyc
     文件        1300  2018-05-07 23:09  gluttonous-master\arena.py
     文件        2912  2017-03-01 06:54  gluttonous-master\circle.png
     文件         670  2017-03-01 06:54  gluttonous-master\define.py
     文件        1632  2017-03-01 06:54  gluttonous-master\dot.py
     文件        1171  2017-03-01 06:54  gluttonous-master\gameover.py
     文件       40830  2017-03-01 06:54  gluttonous-master\getqrcode.jpeg
     文件        1310  2018-05-09 19:09  gluttonous-master\gluttonous.py
     文件         420  2017-03-01 06:54  gluttonous-master\README.md
     文件         176  2018-05-29 22:44  gluttonous-master\setup.py
     文件      710719  2017-03-01 06:54  gluttonous-master\snake.gif
     文件        6444  2018-05-07 21:02  gluttonous-master\snake.py
     目录           0  2018-05-29 22:18  gluttonous-master\snake\
     目录           0  2018-05-29 22:16  gluttonous-master\snake\__pycache__\
     文件        2024  2018-05-29 22:13  gluttonous-master\snake\__pycache__\arena.cpython-34.pyc
     文件        1853  2018-05-09 19:09  gluttonous-master\snake\__pycache__\arena.cpython-36.pyc
     文件        1046  2018-05-29 22:10  gluttonous-master\snake\__pycache__\define.cpython-34.pyc
     文件         969  2018-05-07 21:02  gluttonous-master\snake\__pycache__\define.cpython-36.pyc
     文件        2044  2018-05-29 22:10  gluttonous-master\snake\__pycache__\dot.cpython-34.pyc
     文件        1838  2018-05-07 21:02  gluttonous-master\snake\__pycache__\dot.cpython-36.pyc
     文件        1211  2018-05-29 22:13  gluttonous-master\snake\__pycache__\gameover.cpython-34.pyc
     文件        1089  2018-05-07 21:02  gluttonous-master\snake\__pycache__\gameover.cpython-36.pyc
     文件        1866  2018-05-29 22:16  gluttonous-master\snake\__pycache__\gluttonous.cpython-34.pyc
     文件        6046  2018-05-29 22:12  gluttonous-master\snake\__pycache__\snake.cpython-34.pyc
     文件        5269  2018-05-07 21:02  gluttonous-master\snake\__pycache__\snake.cpython-36.pyc
............此处省略30个文件信息

评论

共有 条评论