- 博客(49)
- 资源 (39)
- 收藏
- 关注
原创 有一只会射子弹的贪食蛇,你见过吗?
在游戏编程学习过程中,我们可以有意识地对游戏案例进行一些改进和创新,这样不仅能增进学习效果,还能提高编程能力。这里简单聊聊改进的思路,一般可以从两方面考虑:一是改变原有的玩法规则,二是综合不同案例的玩法。......
2022-06-04 19:00:50 605
原创 教你用Python开发的一款迷你跑步游戏
今天我们来看看国外开发者“Rik Cross”制作的一款迷你跑步游戏。他用了不到一百行代码,就写出了值得一玩的2D动作游戏,怎么做到的?在此之前,先向大家介绍一个游戏框架:pgzero。该框架全名Pygame Zero,是一个基于Pygame的游戏编程框架。它可以更容易地编辑游戏,无需模板、不用编写事件循环,也无需学习复杂的Pygame API,而且支持树莓派。安装:pip install pgzero需求:通过键盘的左右键操作,让运动员向前奔跑,每过25米有路标提醒,最后看谁在
2022-05-21 17:21:19 948
原创 老游戏新写之Lunar Lander月球登陆
对航空知识有兴趣的朋友都知道,飞行器在月球软着陆不是一件容易的事情。即使在刚刚过去的2019年,印度也没能成功实现该技术,承载着希望的“月船2号”着陆器在距离月球表面2.1公里的时候失去了信号,从此不知所踪。迄今为止,只有中美俄三个国家实现了月球软着陆。印度“月船2号”着陆器失联前的直播画面在阿波罗11号登月十周年纪念日的时候,阿塔里(Atari)公司曾经出了一款名叫“Lunar Lander”的投币式街机游戏。游戏的玩法是通过方向调整和推力控制来引导你的着陆器,将其轻轻地放到安全而
2022-05-21 17:19:49 739
原创 老游戏新写之Jetpac重返地球
主人公流落外星球,遇到一群不讲道理的外星人。想跑路,载具又摔得七零八落。任务:顶着外星人的进攻,把宇宙飞船的零件都找回来组装好,然后为其添加燃料。最后安全逃离,重返地球。这是由Chris和Tim Stamper兄弟于1983年创建的8位机游戏Jetpac里的剧情,也是其工作室Ultimate Play the Game出品的首批热门游戏之一。8位ZX Spectrum电脑上的Jetpac而当一个宇航员和Ultimate Play the Game的徽标在屏幕上出现时,你知道之前的等待是
2022-05-21 17:17:38 242
原创 教你用Python实现经典游戏《小蜜蜂》
估计很多老玩家在小时候都玩过Galaxian(小蜜蜂)吧。这款射击游戏的鼻祖叫《太空侵略者》,上手简单,但可玩性很强。《太空侵略者》大火之后,新推出的Galaxian(小蜜蜂)于1979年成为其最大竞争对手。由Namco发行的Galaxian为外星敌人提供了新的色彩和不可预测的动作,后者不但会发射炮弹,还会自杀式俯冲攻击。《Galaxian》在街机游戏中大受欢迎,以至于Namco在两年后又发布了续作《Galaga》——这款游戏使攻击模式更加复杂。很难说《Galaxian》究竟有多少移植和克隆
2022-05-21 17:14:05 1088
原创 教你用Python实现经典游戏《弹珠台》
弹球游戏如此之多,以至于它本身已经成为一种类型。弹球起源于一种模拟街机,一个金属球将被发射到一个倾斜的游戏区域,并在障碍物之间弹跳。玩家通过按下机器两侧的按钮来操作一对脚蹼,从而将球击回比赛区域,击中障碍物并得分。当球从比赛区底部的出口落下时,比赛结束。视频游戏开发商很快开始尝试重新制作弹球,首先是用相当基本的图形和物理,但随着时间的推移,现实感越来越强——如果你看看1984年任天堂的弹球,然后,比如说,1990年世嘉超级硬盘上的魔鬼迷恋,然后是1992年PC上的弹球梦,你可以看到这一类型在短短几年内发
2022-05-21 17:04:34 969
原创 教你用Python实现经典游戏《泡泡龙》
《泡泡龙》于1986年发布,看起来与当时街机上的任何其他游戏都不一样。这是一款合作游戏,由大藤光二(Fukio Mitsuji)设计,由两名玩家控制一对龙Bub和Bob,并吹泡泡诱捕敌人,然后将其击破。这使得敌方内部受到攻击,并释放了额外的奖励物品,可以获得额外的积分。与当时的各种射击、驾驶和格斗游戏不同,《泡泡龙》是一款具有广泛吸引力的卡通类游戏;Mitsuji在后来的采访中说,他希望这项游戏能让情侣们喜欢。也许这就是为什么泡泡龙在Taito大受欢迎的部分原因,它仍然是20世纪80年代最受欢迎和喜爱的游戏
2022-05-21 16:59:49 1121
转载 Python编写超级玛丽竟如此简单?不信你试试
得益于Python简洁的语法和强大的扩展库,使用Python编写应用变得十分快捷方便。比如今天要介绍的一款经典游戏超级玛丽的编写,如果用其他语言可能要上千行代码,而使用Python最少只需两百多行就可完成。不信?那就让我们一起开始吧。我们使用的扩展库是Pygame Zero(简称Pgzero)。该库是一个基于Pygame的游戏编程框架。它可以更容易地编辑游戏,无需模板、不用编写事件循环,也无需学习复杂的Pygame API,而且支持树莓派。安装: pip install pgzero建立游戏场景
2022-05-21 16:56:34 3235 5
转载 十行代码编写一个Python小游戏,你准备好了吗?
准备好了吗?我们即将开始激动人心的游戏编程之旅。或许你之前学习过一点编程,但若是你从没接触过游戏编程,那么你仍然会对游戏程序的运行感到不解。游戏程序不像计算一个公式或谜题,得到答案之后程序就结束了,游戏程序一直是处于运行中的,只要你不主动退出,那么你可以永远呆在游戏之中。这就游戏循环的神奇魔力。下面我们尝试用最少的代码来编写一个小游戏。准备工作01 选择合适的开发工具“工欲善其事必先利其器”,编写游戏之前得挑选一款合适的工具,这样可以大大地简化程序编写工作。Python语言有很多第三方库都提
2020-11-21 13:54:03 16501 5
转载 CH 2 欢迎来到代码世界
作者:upupzealot原帖地址:http://www.cnblogs.com/upupzealot/archive/2013/01/30/2882289.html 1.殊途同归,开辟代码之路在上一章的demo中,我们已经创建了自己的世界,并在其中添加了一个角色。然而,这个工作并不是我们通过编写程序实现了,而是借助了Greenfoot作为一个简易游戏框架的一些现成的功能。
2013-01-30 21:59:38 2114 1
转载 CH 1 Greenfoot初体验
作者:upupzealot原帖地址:http://www.cnblogs.com/upupzealot/archive/2013/01/26/2877835.html 1.认识Greenfoot界面OK,打开我们之前建立好的Greenfoot空白工程,我们首先将看到这样一个界面。首先我们就来认识一下Greenfoot的这个主界面。首先先来做一个划分然后我们将
2013-01-26 17:57:15 3256
转载 CH0 安装配置Greenfoot
作者:upupzealot原帖地址:http://www.cnblogs.com/upupzealot/archive/2013/01/26/2877596.html 1.获取GreenfootGreenfoot作为一款免费开源的共享软件,可以从其官网下载。(官网地址:http://www.greenfoot.org)进入网站门户后点击“Enter Greenfoot site
2013-01-26 11:18:34 1661
翻译 37.第一季结束
I started the sinepost blog about eight months ago, and since then I’ve written around thirty-five posts — more than one a week. I’ve primarily focused on geometry (and a little mechanics), building g
2012-09-29 20:44:54 702
翻译 35.瞄准
35.Take AimIn our last post, we implemented projectile motion as the start of a game involving monkeys throwing bananas. We saw that projectile motion always follows the same parabolic pattern, wh
2012-09-22 15:00:51 1112
翻译 34.像香蕉一样飞行的水果:抛掷运动
34.Fruit Flies Like A Banana: Projectile MotionSimple projectiles have been popular in games for a long time.Angry Birds recently combined it with collision physics to great success, but long ago, g
2012-09-15 11:42:33 1912
翻译 33. 实现桌球的反弹
33.Making Your Balls BounceIn this post, we will finally complete our pool game. We’ve already seenhow to detect collisions between balls: we just need to check if two circles are overlapping. We’
2012-09-07 22:31:35 2141
翻译 32. 更加有效地墙壁反弹
32. Bouncing Off The Walls, More ProductivelyIn a previous post we saw one way to bounce a ball off walls, by using angles and rotation. In maths, there are often several ways to approach a proble
2012-09-01 19:54:20 1288
转载 31. Rack ‘Em Up
In recent posts, we’ve been building a pool game. One aspect of pool that we need to implement is positioning the balls for the start. There are fifteen balls to line up in a tightly packed triangle.
2012-08-27 08:51:30 797
翻译 30.在墙壁间反弹
30.Bouncing Off The WallsIn this post we will continue building our pool game. One of the aspects of a pool game that we will need is the ability for the balls to bounce off the edges/cushions of
2012-08-21 15:20:00 1591
翻译 29.桌球知识:两个圆之间的碰撞检测
29.Pooled KnowledgeIn this post we’re going to start work on a pool game. Pool is quite a nice example for a game, because really it’s a two-dimensional game. The balls are always (trick shots aside
2012-08-02 08:38:55 1990
翻译 28. 图像旋转
28.Image RotationThis post is a quick diversion, on request from a user on the Greenfoot site. They asked how to rotate an image, which is actually quite a simple task, given what we have already
2012-08-02 08:35:38 994
翻译 27.直线上的第一个:只获取直线上第一个被碰撞的物体
27.First In Line: taking only the first item that a line collides with.In our last post we added a laser to our spaceship that shot asteroids. It was a very powerful laser, because it would shoot
2012-08-02 08:32:37 589
翻译 26.激光切割机:不放过任何目标;在直线和圆之间进行碰撞检测
26.Laser Cutter: Don’t Miss A Thing; collision detection between a line and a circleIn our last post, we saw how to do collision detection between bullets (modelled as an exact point) and asteroid
2012-08-02 08:27:08 1102
翻译 25. 射击石头:在点和圆之间进行碰撞检测
25.Shooting Rocks: Collision Detection between a point and a circleThe very first example on this blog looked at moving a spaceship around. In this post we’ll return to our spaceship, and get it s
2012-08-02 08:17:15 1076
转载 24.Doomed: Trigonometry in an early first-person shooter game
Today’s trigonometry example comes from gaming history: the early days of what are now known as first-person shooters (FPS). But don’t worry, you don’t need to like or play FPS games to understand thi
2012-08-02 08:15:39 725
翻译 23. 另一种砖块墙面:纹理映射
23.Another Brick In The Wall: Texture MappingIn our last post, we drew a 3D view of being in a maze-like grid of blocks. But all the walls were of single uniform colour, which is quite dull. The e
2012-08-02 08:09:28 831
翻译 22. 走进三维:光线投射法
22.Approaching the Third Dimension: RaycastingLet’s think for a moment about how to implement 3D graphics. One 3D graphics technique, ray-tracing, takes inspiration from the physical world. In the p
2012-08-02 08:06:57 1608
翻译 21.视线:在网格中计算可见性
21.Lines of Sight: Calculating visibility on a gridLast post, we developed a game where your robotic opponents all come towards you and you must fire at them to stop them. It was made somewhat eas
2012-08-02 08:00:21 972
翻译 20.机器人逃犯:在网格中射击
20.Robotic Outlaws: Shooting on a gridRecently, we’ve seen how to find your way around a grid, and how to draw a line between two points, choosing which pixels to illuminate. Now we’ll move on to ga
2012-08-01 11:09:26 1635
翻译 19.绘制一条直线:在绘制直线时决定去填充哪些像素
19.Drawing in a Straight Line: Deciding which pixels to fill when drawing a lineOn paper, drawing a straight line between two points is easy: Put your ruler down on the page, and run your pencil acr
2012-08-01 11:08:41 2826
翻译 18.寻找你周围的道路:在设有障碍物的网格中寻路
18.Finding Your Way Around: Pathfinding on a grid with obstaclesIn the last post we saw about distances with horizontal and vertical movement, and how to move one object towards another using hori
2012-08-01 11:08:15 2227
翻译 17. 首先我们获取曼哈顿距离:如何在一个网格里测量距离
17.First We Take Manhattan: How to measure distance on a gridWe saw very early on in this blog how to make an actor aim for a target location. One way to use this is for enemies chasing you in gam
2012-08-01 11:07:47 2322
转载 16.Checkpoint!: Adding checkpoints to the racing scenario by looking at the intersection of two line
In a recent post, we had a bus racing around a track. A nice finishing touch would be to add a facility to measure lap-times. But how can you measure when someone has completed a lap? The first step
2012-08-01 11:06:53 891
翻译 15.理论知识:直线
15.Theory: LinesThis post is a bit of background on lines, which we’ll be using in the next post to finish offour bus scenario.这篇帖子是关于直线的一些背景知识,我们将在下篇帖子里用其来完成我们的巴士剧本。Mathematics typically only
2012-08-01 11:06:23 843
翻译 14.像巴士一样行驶:在位置基础上添加摩擦力
14.Driving – Like A Bus: Adding friction based on location, and that differs sideways to forwards.This post is about adding friction, or: rotating, splitting and manipulating vectors.这篇帖子讨论添加摩擦力,或
2012-08-01 11:05:44 883
翻译 13.理论知识:向量
13.Theory: VectorsThis post is a bit of theory about vectors, ready for more work onour bus scenario.这篇帖子介绍一点关于向量的理论,这是为进一步完善巴士游戏剧本做准备。A lot of the recent posts on this blog (e.g. on drifting, b
2012-08-01 11:05:12 719
翻译 12.燃烧的橡胶:使用极坐标旋转位置
12.Burning Rubber: rotating positions using polar coordinatesThis post is about rotating coordinates by using polar coordinates.这篇帖子讨论使用极坐标进行坐标的旋转In our last post, we added a braking capabilit
2012-08-01 11:04:34 2345
翻译 11.巴士停不下来:使用固定或按比例方式实现减速
11.The Bus That Couldn’t Slow Down: implementing braking using fixed or proportional slow-downThis post is about two different ways of implementing braking.这篇帖子讨论两种实现减速的不同途径。In a recent post, we
2012-08-01 11:04:00 1756
翻译 10.敢问路在何方?:笛卡尔坐标和极坐标的转换
10.Where Am I Headed?: converting between cartesian and polar coordinatesThis post is about calculating your direction and overall speed from your X and Y speeds and restricting maximum speed, or: c
2012-08-01 11:03:19 4394 1
greenfoot技术博客源码
2013-07-06
【源码】樱桃女孩游戏源码
2012-05-12
游戏关卡编辑器V1.1
2012-05-12
【附源码】游戏关卡编辑器
2012-05-06
游戏编程课件+源代码+实验指导
2011-03-28
【资源共享】游戏编程方面的学习资料(包括新版教材的电子教案和所有源程序代码)
2011-03-23
+++++++【精品免费分享】+++++++《游戏程序设计教程》随书课件+源程序代码
2011-03-22
java游戏程序设计课件ppt
2009-05-20
# 基于《趣学Pyhon游戏编程》第九章推箱子游戏源代码pushbox.py # 加入了关卡间的穿行功能
2023-01-31
java反编译工具
2016-05-28
中国象棋Greenfoot欢乐版(含源码)
2015-04-11
《Java游戏程序设计教程(第二版)》电子教案
2014-06-19
【课件】Java程序设计_游戏动画案例教程
2013-11-25
java课件(BlueJ教材)
2013-07-21
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人