freegame
k__opp
这个作者很懒,什么都没留下…
展开
-
2021-06-03 10 数对拼图
数对拼图游戏"""Memory, puzzle game of number pairs.Exercises:1. Count and print how many taps occur.2. Decrease the number of tiles to a 4x4 grid.3. Detect when all tiles are revealed.4. Center single-digit tile.5. Use letters instead of tiles."""fr原创 2021-06-03 23:30:38 · 309 阅读 · 1 评论 -
2021-05-31 9 maze迷宫
很简单 只是实现了画出迷宫和走迷宫的效果"""Maze, move from one side to another.Excercises1. Keep score by counting taps.2. Make the maze harder.3. Generate the same maze twice."""from turtle import *from random import randomfrom freegames import linedef draw(原创 2021-06-03 22:29:04 · 205 阅读 · 0 评论 -
2021-05-31 生命模拟游戏
"""Game of Life simulation.Conway's game of life is a classic cellular automation created in 1970 by JohnConway. https://en.wikipedia.org/wiki/Conway%27s_Game_of_LifeExercises1. Can you identify any Still Lifes, Oscillators, or Spaceships?2. How ca原创 2021-05-31 21:07:41 · 255 阅读 · 1 评论 -
7 flappy bird
"""Flappy, game inspired by Flappy Bird.Exercises1. Keep score.2. Vary the speed.3. Vary the size of the balls.4. Allow the bird to move forward and back."""from random import *from turtle import *from freegames import vectorbird = vector(0,原创 2021-05-31 20:40:51 · 176 阅读 · 0 评论 -
6点击旋转 freegame
onkey(flick, 'space')listen()该函数的使用 绑定事件"""Fidget, inspired by fidget spinners.Exercises1. Change the spinner pattern.2. Respond to mouse clicks.3. Change its acceleration.4. Make it go forwards and backwards."""from turtle import *stat原创 2021-05-30 19:35:37 · 150 阅读 · 0 评论 -
凯撒密码
凯撒密码一种最简单且最广为人知的加密技术。它是一种替换加密的技术"""Crypto: tool for encrypting and decrypting messages.Exercises 加深练习1. Review 'ord' and 'chr' functions and letter-to-number mapping. 转数字 和 数字转字符2. Explain what happens if you use key 26. 与原码保持不变 移动了26位3.原创 2021-05-22 11:53:40 · 449 阅读 · 0 评论 -
四子棋 freepython
四子棋,是黑白棋的一种。是一种益智的棋类游戏。黑白两方(也有其它颜色的棋子)在8*8的格子内依次落子。黑方为先手,白方为后手。落子规则为,每一列必须从最底下的一格开始。依此可向上一格落子。一方落子后另一方落子,依此抡次。直到游戏结束。"""Connect FourExercises1. Change the colors.2. Draw squares instead of circles for open spaces.3. Add logic to detect a full row.4原创 2021-05-21 23:20:16 · 634 阅读 · 3 评论 -
4炮打小球 freepygame
炮打小球想了半天 我想实现点击屏幕出现一个小球后 再点击屏幕还会出现别的小球,想用列表存储小球 不知道为什么加入第二个小球后屏幕卡住了"""Cannon, hitting targets with projectiles.炮弹打小球Exercises1. Keep score by counting target hits.2. Vary the effect of gravity.3. Apply gravity to the targets.4. Change the speed o原创 2021-05-21 22:13:27 · 283 阅读 · 2 评论 -
3 小球反弹
和蚂蚁爬爬代码很像,其中不知道的方法可以去那个文章看看蚂蚁"""Bounce, a simple animation demo.Exercises小球反弹"""from random import *from turtle import *from freegames import vectordef value(): """随机生成(-5,-3)或(3,5)之间的值。""" return (3 + random() * 2) * choice([1, -1])原创 2021-04-18 11:16:17 · 111 阅读 · 0 评论 -
2 猜数字的游戏
"""Bagels, a number puzzle game.猜数游戏"""from random import sample, shuffledigits = 3guesses = 10print('我想了一个', digits, '位数.')print('你可以试试猜出来')print('=下面是一些有助于你猜出的规则')print('当你猜出的数字满足以下我会提示')print(' pico: 有一个数字猜对了但是位置不对.')print(' ferm原创 2021-04-18 11:12:09 · 173 阅读 · 1 评论 -
python freegames配合turtle 实现一些简单游戏
github参考地址真·入门级 Python 游戏集合库。贪吃蛇、迷宫、Pong、猜字等,运行简单(有些不需要安装依赖)、代码少且易读。用游戏开启的你 Python 项目之旅,玩完再学源码下载模块 主要的pip install freegamespip install turtle第一个 蚂蚁爬爬"""Ant, simple animation demo.蚂蚁随机爬"""from random import *from turtle import *from freega原创 2021-04-18 11:02:28 · 1001 阅读 · 2 评论