资源简介
用python语言以及numpy, soundfile, 写成的跳棋类游戏, 界面简单, 逻辑清楚, 提供一个可扩展易维护的框架供大家扩展研究。

代码片段和文件信息
“““Ant simple animation demo.
Exercises
1. Wrap ant around screen boundaries.
2. Make the ant leave a trail.
3. Change the ant color based on position.
Hint: colormode(255); color(0 100 200)
“““
from random import *
from turtle import *
from freegames import vector
ant = vector(0 0)
aim = vector(2 0)
def wrap(value):
“Wrap value around -200 and 200.“
return value # TODO
def draw():
“Move ant and draw screen.“
ant.move(aim)
ant.x = wrap(ant.x)
ant.y = wrap(ant.y)
aim.move(random() - 0.5)
aim.rotate(random() * 10 - 5)
clear()
goto(ant.x ant.y)
dot(4)
if running:
ontimer(draw 100)
setup(420 420 370 0)
hideturtle()
tracer(False)
up()
running = True
draw()
done()
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2019-05-11 08:52 freegames\
文件 748 2019-05-11 08:52 freegames\ant.py
文件 1640 2019-05-11 08:52 freegames\bagels.py
文件 837 2019-05-11 08:52 freegames\bounce.py
文件 1486 2019-05-11 08:52 freegames\cannon.py
文件 81863 2019-05-11 08:52 freegames\car.gif
文件 1094 2019-05-11 08:52 freegames\connect.py
文件 2021 2019-05-11 08:52 freegames\crypto.py
文件 857 2019-05-11 08:52 freegames\fidget.py
文件 1322 2019-05-11 08:52 freegames\flappy.py
文件 636 2019-05-11 08:52 freegames\guess.py
文件 1591 2019-05-11 08:52 freegames\life.py
文件 782 2019-05-11 08:52 freegames\maze.py
文件 1736 2019-05-11 08:52 freegames\memory.py
文件 2045 2019-05-11 08:52 freegames\minesweeper.py
文件 4401 2019-05-11 08:52 freegames\pacman.py
文件 1656 2019-05-11 08:52 freegames\paint.py
文件 1772 2019-05-11 08:52 freegames\pong.py
文件 1512 2019-05-11 08:52 freegames\simonsays.py
文件 1364 2019-05-11 08:52 freegames\snake.py
文件 1091 2019-05-11 08:52 freegames\tictactoe.py
文件 1865 2019-05-11 08:52 freegames\tiles.py
文件 1255 2019-05-11 08:52 freegames\tron.py
文件 10154 2019-05-11 08:52 freegames\utils.py
文件 2914 2019-05-11 08:52 freegames\__init__.py
文件 1714 2019-05-11 08:52 freegames\__main__.py
相关资源
- 二级考试python试题12套(包括选择题和
- pywin32_python3.6_64位
- python+ selenium教程
- PycURL(Windows7/Win32)Python2.7安装包 P
- 英文原版-Scientific Computing with Python
- 7.图像风格迁移 基于深度学习 pyt
- 基于Python的学生管理系统
- A Byte of Python(简明Python教程)(第
- Python实例174946
- Python 人脸识别
- Python 人事管理系统
- 基于python-flask的个人博客系统
- 计算机视觉应用开发流程
- python 调用sftp断点续传文件
- python socket游戏
- 基于Python爬虫爬取天气预报信息
- python函数编程和讲解
- Python开发的个人博客
- 基于python的三层神经网络模型搭建
- python实现自动操作windows应用
- python人脸识别(opencv)
- python 绘图(方形、线条、圆形)
- python疫情卡UN管控
- python 连连看小游戏源码
- 基于PyQt5的视频播放器设计
- 一个简单的python爬虫
- csv文件行列转换python实现代码
- Python操作Mysql教程手册
- Python Machine Learning Case Studies
- python获取硬件信息
评论
共有 条评论