gamemaker-1945飞行射击游戏制作.doc

上传人:鲁** 文档编号:560584552 上传时间:2023-07-10 格式:DOC 页数:25 大小:2.80MB
返回 下载 相关 举报
gamemaker-1945飞行射击游戏制作.doc_第1页
第1页 / 共25页
gamemaker-1945飞行射击游戏制作.doc_第2页
第2页 / 共25页
gamemaker-1945飞行射击游戏制作.doc_第3页
第3页 / 共25页
gamemaker-1945飞行射击游戏制作.doc_第4页
第4页 / 共25页
gamemaker-1945飞行射击游戏制作.doc_第5页
第5页 / 共25页
点击查看更多>>
资源描述

《gamemaker-1945飞行射击游戏制作.doc》由会员分享,可在线阅读,更多相关《gamemaker-1945飞行射击游戏制作.doc(25页珍藏版)》请在金锄头文库上搜索。

1、卷轴式游戏是一种非常流行的动作游戏, 用Game Make很容易就能作出来。在这个教程里我们会用到和学到Game Maker的一些知识,尤其是变量的使用。在卷轴式游戏里玩家控制一个物体(Object),一架飞机,一艘飞船或一辆汽车在背景穿梭,在背景里出现的障碍物必须要躲避,敌人一定要射击。难度会越来越高,玩家要想方设法地生存下来。(下面都是一些废话)变量和属性介绍x 实例的X坐标y 实例的Y坐标hspeed :水平方向的速度 (in 像素 per step)vspeed :垂直方向的速度 (in pixels per step)direction :当前运动的方向,用角度表示。 (0-360;

2、 0 是向右的水平)speed :当前方向的速度。教程: 卷轴式射击游戏制作版权: 2005-2006, 游戏制作者最后编辑: 2月10日, 2006使用: version 6.0,高级模式等级: 初学者翻译:Qiou 月光下的魔术师In this tutorial we will create a scrolling shooter called 1945, in which the player flies in a plane over a sea and enemy planes try to destroy the player. We will treat aspects like

3、how to create the illusion of motion using a scrolling background, how to control the plane, how to make enemies and bullets, and how to deal with the score, with lives and with the damage of the plane. But first of all we delve into a very important aspect of Game Maker that extends the possibiliti

4、es considerably: the use of variables.在开始这篇教程之前我们先介绍一下GM一个重要的概念:variable(变量)它最好理解成一个物体的一个实例的属性。当我们定义一个物体(object)时,会用到好多特定的属性,比如我们设置一个物体是否可见,是否是固态,还有许多动作(action)能改变这些属性值,比如改变位置啦,改变实例的速度等。每个实例都有自己的属性,还有一些全局属性,比如分数,与哪个实例都没直接关系,这些属性都以自己的名字以所谓的变量形式被游戏保存起来。下面是游戏要用到的一些公用变量/属性,你可以在任何地方引用它们。: If a variable h

5、as a 如果值是Game Maker文档里随处可见一些实例的局部和全局变量。有一些动作可以操纵这些变量值。但是,我们也可以直接操纵这些变量值。更好的是,我们可以定义自己的变量,使用它们。比如,下面我们将看到的,我们想让我们的飞船一次只能Shoot一次每5步在游戏里。所以我们的飞机需要一个属性指示它是否能射击。我们将这个属性变量称之为can_shoot. (A variable name can only consist of letters and the underscore symbol. Variable name are case-sensitive, so Can_Shoot is

6、 not the same variable as can_shoot.) 在创造飞船事件中我们将它设为1.(1等价为true.) 当玩家想开火时我们检查它是否为1.一旦开火后立即设它为0(暂时不允许再射击。) 然后我们再使用一个时钟报警事件重新设它为一,在5步之后。下面我们将详述之,同理我们可以使用变量让飞机设为是否在保护状态,是否可以进行武器升级,等等。 Score:分数lives :生命mouse_x 鼠标的X坐标mouse_y 鼠标的Y坐标room_speed 场景当前运行的速度。room_caption 场景显示在窗口的标题 room_width width of the room

7、in pixelsroom_height height of the room in pixelsvisible 物体是否可见 (1) or 不可见 (0)solid 物体是否实心(1) or 不实心 (0)And 这儿是一些全局变量 variables:有两个重要的可以直接处理变量的动作。 Set the value of a variable设置变量值。用这个动作我们可以改变给定变量的值。.你也可以用它定义自己的变量名和初值。 当你勾选 Relative 复选框 给定值会加在当前变量值上。注意这只能是当前变量已经有值分配的情况下。 Rather than providing a simpl

8、e value for the variable you can also give an expression. 例如,你想将你的分数加倍,你可以将score值设为:2*score.让我们看看我们将要制作的游戏吧,作一个游戏之前先要作一个设计文档。用这个运作你可以检查给定变量的值是什么。如果变量值等于你指定的数值,则反回true.并且下个动作模块会被执行;否则下个动作模块不会被执行。你也可以检查变量值小于可大于你指定的数值。你甚至可以随心所欲使用各种表达式。下面我们会给出一些例子说明它们的用法。还有一些有关变量的内容你要了解的。刚才我所说的那些局部变量是“属于”实例本身的。还有一些全局变量也

9、是如此。当你定义使用你自己的变量时那只是一些局部变量,它依附于实例和那些特定动作上。如果你想用你自己的全部变量,你必须重新修正名字,在它前面加个“global.”例如,你可以用一个变量global.bonus 指示搜集玩家的奖赏分数。小心不要让变量名与其它已经存在的图例,声音名重复。一个方法是总是让你的变量以 var开头。_.19451945 design documentDescriptionIn this game you control a plane flying over a sea. You encounter an increasing numberof enemy planes

10、 that try to destroy you. You should avoid these or shoot them. The goalis to stay alive as long as you can and to destroy as many enemy planes as you can.Game objects游戏背景是由海面和小岛组成,还有玩家的飞机。敌人有四种类型的飞机。over this sea. You can shoot bullets that destroy enemy planes. There are four types ofenemy planes:

11、 a plane that you encounter and should be destroyed, a plane that firesbullets downwards, a plane that fires bullets towards the players plane, and a fast enemyplane that comes from behind rather than from the front.SoundsThere are some explosion sounds and there is some background music.ControlsThe

12、 player controls the game with the arrow keys. With the space key you fire a bullet.Only one bullet can be fired every five steps.Game flowThe player immediately jumps into the game. The player has three lives. When all livesare gone a high-score table is shown. Pressing the (help) key will give a b

13、riefexplanation. Pressing the key will end the game.LevelsThere is just one level, but more and more enemy planes will arrive: first only the easytype but later the more difficult types.玩家控你的黄色飞机飞过天空。四种类型的敌机会以图形显示。在底部有分数,生命数还有你的损坏量。The illusion of motionA scrolling shooter thanks its name to the fac

14、t that the game world scrolls over the screen, normally either from top to bottom or from right to left. This gives the illusion of motion. In the game 1945 the game world scrolls vertically. Even though the plane the player controls actually stands still on the screen you get the impression as if i

15、t flies over the scrolling background. You can control the position of the plane by moving it around on the screen. This gives the impression of the plane speeding up, when it moves forwards, or slowing down when it moves backwards. It is crucial that the plane does not move faster backwards than th

16、e background scrolls. This would give the illusion that the plane flies backwards, which is of course impossible.我们怎么样才能作出这样的背景?有两种方法,一种是你用现成的素材,为了加强动感我们需要加一些小岛。一种方法是创造一个更大背景图案,把这些小岛加进去。这种方法不好,工作量太大。另一种,更复杂的是你创造一个更大的room,但它也只是显示整个room的一部分,我们称为“view”这个view慢慢地向上推进,下面我们将向第二种方法介绍。我们的游戏发生在海上我们要用一个背景图片看起来向从上往下看的海面。我们添加下面这个小图

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号