空间游戏怎么创造,就是怎么发明创造事例一个游戏

>> 小记者寄语两会:为孩子们创造一个绿色游戏空间
小记者寄语两会:为孩子们创造一个绿色游戏空间
来源: &&&&&&编辑:万民&&
内容提要:在小记者们采访中国高科技产业化研究会副理事长刘延宁奶奶时,她建议,如果将孩子们喜欢玩游戏的爱好,变成创造游戏、制作游戏的“职业”,那不就能解决孩子玩游戏上瘾的问题吗?同时,各相关部门也可组织丰富多彩的电脑程序大赛,让喜欢玩电脑的同学们都有机会参与到比赛中去。
&&& 2015年全国“两会”期间,来自全国各地的18名未来网小记者们有幸参与了在团中央网络影视中心召开的“中国绿色网络建设与青少年健康成长座谈会”,来自全国各条战线上的两会代表委员和青少年代表、网络游戏玩家代表等共计50余人参与大会。&
会上,大家就“怎样正确引导孩子们上网、是否应该让孩子们玩游戏、孩子们应该玩怎样的游戏”等话题展开了热烈的讨论,并且达成共识:共同为孩子们创造一个绿色的游戏空间,让孩子们健康成长。&
&&& 会议结束后,宁波小记者们有幸采访了部分参与活动的代表委员。全国政协委员、中华孔子学会副会长凌孜奶奶,她希望相关部门可以多创建一些知识类的游戏,让孩子们既能玩,又能学习,也希望我们回去后转告给身边的同学们,让他们能够合理安排游戏时间。&
中国高科技产业化研究会副理事长刘延宁为孩子们写寄语&
&&& 在小记者们采访中国高科技产业化研究会副理事长刘延宁奶奶时,她建议,如果将孩子们喜欢玩游戏的爱好,变成创造游戏、制作游戏的“职业”,那不就能解决孩子玩游戏上瘾的问题吗?同时,各相关部门也可组织丰富多彩的电脑程序大赛,让喜欢玩电脑的同学们都有机会参与到比赛中去。&
&&& 通过短短的座谈会,让现场的孩子们懂得了健康游戏的重要性和沉迷游戏的危害,全体小记者一致表示回去后要将座谈会精神宣传给身边的同学们!&
相关新闻:
&&|&&&&|&&
版权所有:共青团中央网络影视中心信息网络传播视听节目许可证0105108号
京ICP备号-1安卓空间游戏大全
在游戏的世界中你可以到达任何你想去的空间,就像坐飞机一样,不过这可比你坐飞机的感觉快多了,这里面还没有任何阻力,只要你想你就能能够一键到达,好玩的安卓空间游戏推荐给各位玩家朋友,赶紧来体验一下非一般的感觉吧!
大小:30MB
简介:魔方穿越(Cubic Tour)这是一款介于2D和3D之间的游戏,可以锻炼到玩家的空间想象力,将四四方方的魔法正确的放在墙上即可。 魔方穿越
大小:421MB
简介:马格努斯博士的梦境空间2解锁版是一款画面非常神秘的冒险类解谜游戏,游戏是以西方魔幻世界为背景的,游戏玩法的挑战性也是非常的强大的,体验不同寻
大小:19MB
简介:主神空间7是一款超自由度的游戏,不是说游戏中能干的事情特别多,而是让玩家来做一个游戏世界....制作商这样真的好吗...总之这里的一切都要有
简介:空间制裁是一款经典的回合制战略游戏,自从发布以来已经经历很长的一段时间,用时间证明了它的生命力!游戏中你需要全局考虑自己的手上所拥有的士兵,...
大小:23MB
简介:适用范围重力拼图是一款特殊的拼图类休闲游戏,游戏采用3D立体的效果是拼图变得有趣。游戏包括54水平,其中逐渐增加的复杂性,它们变得越来越复杂...
简介:三维空间飞球是一款精彩好玩的三维空间飞球休闲游戏,在游戏中玩家需要控制小球前行。在急速的三维世界中,最大努力的保持你的球在赛道上,并非书前进...
大小:48MB
简介:战争空间:策略是一款画面非常精美简洁带有科技色彩的结合了RPG元素的太空战争类策略游戏,在游戏中玩家需要通过只会各种太空舰船来完成游戏的任务...
大小:667MB
简介:空间站模拟(Space Simulator)是一款模拟经营类游戏,喜欢航空的朋友们有福了,这款游戏可是完全模拟了国际航天的各种运行。 要是你...
大小:48MB
简介:七天惊恐逃生空间(sevendays In Horror)是一款让你陷入无限恐怖氛围之中的冒险类游戏,游戏中你将独自一人在险境中生存下去,这...
大小:35MB
简介:空间恐惧是一款画面阴暗带有恐怖风格的虚拟现实类游戏,在游戏中玩家可以亲身体验到未知的太空环境,有一种恐怖和紧张的气氛油然而生,游戏能让玩家感...
简介:空间先生(Mr.Space!!)是一款相当有乐趣的休闲益智类游戏,游戏主人公在一片奇异的山洞中冒险,让我们来看看他都会遇到什么惊险的事情吧。...
大小:21MB
简介:空间射击3:消逝的帝国破解版是一款画面非常精美以星际为背景的战争策略类游戏,玩家在游戏中需要通过控制自己的舰队飞船去完成一系列的战斗任务。游...
简介:欧几里得之地手机版非常可玩,这款需要玩法与众不同,玩家能够感受别致的战斗体验,欧几里得是古希腊最负盛名、最有影响的数学家之一,被称为几何之父...
简介:欧几里得之地邀请码是一款非常受玩家期待的解谜休闲类游戏,游戏中有着多样的策略玩法元素,巧妙利用空间策略来打败恶魔。 值得一提是,游戏名称灵感...
简介:Baseless是一款快节奏的空间射击游戏。玩家要做的就是操纵宇宙牛仔不停地跳跃,并在跳跃的同时开枪射击。游戏的操作相当简单,只需要一根手指...
大小:27MB
简介:空间隧道是一款画面非常精致细腻以科幻风格为题材的街机飞行类竞速游戏,在游戏中玩家需要驾驶酷炫的飞机在赛道上完成飞行跑酷任务,躲避道路上的各种...
简介:空间跳棋是一款休闲类的棋牌游戏,游戏背景以宇宙为题,而棋子也是各大行星,玩起来大气磅礴十分过瘾。要是觉得游戏还不错就下载下来玩着试试吧。 你...
大小:174MB
简介:死亡空间破解版是一款画面非常精致带有浓厚科技感的第三人称射击类游戏,在游戏中玩家需要控制主角进行射击战斗,游戏画面带有恐怖气氛非常刺激哦。玩...
简介:空间赛车是一款画面非常精美带有科幻效果的趣味飞行类休闲游戏,在游戏中玩家需要通过控制飞船在宇宙中完成飞行任务。在游戏中玩家需要通过控制飞船左...
大小:421MB
简介:马格努斯博士的梦境空间2是一款以20世纪20年为背景的冒险类解谜游戏,游戏中将会为你精心设计了N个小游戏,你将面临的是解开一个又一个谜团,快...
简介:魔方2D空间是一款画面非常精美以魔方为题材的益智类休闲游戏,在游戏中玩家需要通过点击来完成游戏的操作,游戏中的关卡非常丰富,快来下载游戏试试...
大小:26MB
简介:空间战争是一款画面非常清新简洁带有涂鸦风格的休闲类射击游戏,在游戏中玩家需要控制飞船射击前进消灭路上的各种障碍和敌人,游戏的操作非常简单,游...
大小:31MB
简介:空间喇嘛是一款画面非常简洁清爽色彩丰富的益智类射击游戏,在游戏中玩家需要控制各种不同形状的元素进行射击,游戏的操作非常简单,游戏中有着非常丰...
简介:欧几里得之地官网游戏非常耐玩,游戏里有着不一样的玩法设计,实际上,《欧几里得之地》对《纪念碑谷》的借鉴是非常有限的,小清新的色调只能说神似,...
简介:欧几里得之地破解版是一款有着全新趣味解谜玩法的手机游戏,游戏将空间结构与战斗策略融为一体,为我们带来了一个精彩的策略玩法游戏。 随着游戏的推...
大小:35MB
简介:机器人闯迷宫 是一款休闲益智类小游戏。 这是最好的空间解谜游戏,引导机器人通过60个独特的充满了激光、虫洞和移动箱子的迷宫。 帮助你的机器人...
大小:92MB
简介:超级英雄队长版是首款冒险卡牌手游《超级英雄》 与他们一起,让世界知道你的存在! 宇宙是造物主从一个奇点以大爆炸的方式制造出来的。在造物主的调...
大小:18MB
简介:OX大战3D(TriXOs)是一款棋牌游戏。还记得没有棋盘,在语文作业本上就可以玩的小游戏吗?跟你的好朋友在作业本的方格中,画上圈圈和叉叉就...
大小:24MB
简介:方舟小行星是一款像素休闲游戏,在游戏中你控制的航天器,它能够监视空间物体。在这种情况下,该对象是一个小行星。你的目标是创造宇宙中的混乱和摧毁...
大小:30MB
简介:黑暗空间:迷雾之城完整版是一款画面精美且剧情扣人心弦的冒险解谜类游戏,在游戏中玩家需要找出游戏中隐藏的线索并解开各种谜题。游戏是系列解谜游戏...
大小:23MB
简介:移动空间化学站是一款画面较为沉郁以太空为背景的益智类解谜游戏,在游戏中玩家需要通过操作运用空间站的一切物品进行游戏,游戏中的特效非常有科技感...
大小:19MB
简介:空间站防御3D是一款画面非常精美带有科幻效果的策略类塔防游戏,在游戏中玩家需要在太空中控制各种武器系统,在敌人靠近之前释放出最强攻击,将它们...
大小:21MB
简介:波束空间是一款不同于其他射击类游戏的一款飞行战斗游戏,游戏中玩家需要控制战机去不断的吸收各种颜色的晶石来完成战斗射击任务。游戏的玩法与其余一...
大小:15MB
简介:空间岛屿(Space Island)是一款玩法相当紧张刺激的怪兽射击类游戏,游戏中将会出现各种不同品种的怪兽们,看着这些怪兽们你会有种跃跃欲...
大小:33MB
简介:DJ空间是一款画面非常精美色彩绚丽以音乐为题材的创意休闲类游戏,玩家在游戏中需要通过构建太空元素来完成自己乐队的组建。通过太空元素,构建自己...
大小:32MB
简介:立方三维空间是一款益智休闲,游戏使用星座的题材,每一关都设计的十分用心,而星座的切入也让我们对这款游戏更加有了兴趣,来看看你的星座都是那些关...
大小:40MB
简介:电子弹球(Electro Rush)是世界最简单的休闲游戏,现在以3D形式重新展现! 游戏画面效果看上去非常不错,另外介绍中所提到的世界最简...
大小:34MB
简介:空间拼图是一款益智类游戏,游戏可能需要一定的逻辑思维能力,游戏画面十分出众,各种星座,以及神话女神,都能在游戏里见到,感兴趣的话就赶紧来体验...
大小:15MB
简介:超空间飞行(Speed Flight Simulator)是一款飞行竞速游戏,游戏画面逼真,各色背景十分带感,操作起来非常顺手,同时对于一些...
大小:15MB
简介:超空间飞行破解版是一款画面非常简洁带有科技效果的飞行模拟类游戏,在游戏中玩家需要控制飞行器在科幻的空间中飞行躲避各种障碍和危险完成游戏任务。...
简介:空间之刃是一款科幻风格的机甲战争类游戏,游戏中玩家只需轻轻的点击屏幕进行跳跃攻击即可,游戏巧妙的运用全虚拟来进行操作,各种炫酷的动作哦,等你...
简介:逃离空间是一款画面非常精美操作简单的横版飞行跑酷类游戏,在游戏中玩家需要控制主角驾驶非常在充满肠癌的环境下完成逃脱任务。这个游戏只要玩上一次...
简介:最佳视角是一款非常具有自己独立特色的解谜类手机游戏,这款游戏也是相当的考验玩家的空间思维能力,让你通过一些细节联想出事情的真相!...
大小:21MB
简介:空间小球(Cargo Run)是一款基于重力感应的益智类休闲游戏,游戏中你将操控手机晃动来滚动这个小球,进行跳跃闯关,快点让小球滚起来! ...
大小:46MB
简介:空间争夺(DiceTris+)是一款让你脑洞大开的简约风格益智类游戏,看着游戏中的形状,瞬间让小编想起来键盘的感觉,只不过这里面都是色彩亮丽...
简介:南瓜大战怪物是一款塔防游戏,好游戏非常有趣操作很简单,滑动南瓜,攻击怪物。画面非常个性丰富。月圆之夜,黑暗世界不再平静,怪物们苏醒过来,开始...
简介:空间街球是一款篮球竞技游戏,游戏制作十分精良,是一款喜欢篮球的小伙伴完全不能错过的好游戏。 游戏采用先进的物理引擎,仿真真实球赛中投球实感街...
合集推荐Collections
CopyRight2004年-年
游迅网 All Rights Reserved
备案编号:沪ICP备号-9给孩子创造一个多彩的游戏空间
资料价格:5学豆&&[]&&
文件类型: (doc)[]
文件大小:22.0 KB
上传时间:
标&&&&&&&签: & & &
论文写作技巧
给孩子创造一个多彩的游戏空间 本文來自:广告设计 /topic/115/
您可能需要的
[] [] [] [] [] [] [] []如何创造一款太空射击游戏(一) - 推酷
如何创造一款太空射击游戏(一)
在这一教程序列中,我们将学习如何创造出像经典的《空间防御》这样的太空射击游戏。
Space Defender(from app4smart)
在这一版本的《空间防御》中,玩家将通过射击敌人保卫自己的空间。每当玩家成功消灭一个敌人时,他们便会获得分数点,而当玩家拥有了20或40个分数点时,他们的枪支便能升级。游戏还会发送价值5个点数的奖励包。既然对这款游戏有了初步了解,我们便可以开始创造了。
我们将使用Corona SDK创造这一太空射击游戏。以下是在这系列教程中会出现的内容:
快速介绍Corona的故事板
如何在创作功用授权下使用原图
如何使用像按键等小工具
如何使用Corona SDK创造一款完整的游戏
你需要什么
为了使用这一教程,你需要在自己的计算机上安装Corona SDK。如果你没有SDK,前往创造一个免费的帐号并下载免费的软件。
1.创造配置
我们设置游戏的第一步便是创造一个build.settings文件。这一文件将处理我们应用中的所有创造时间属性,如面向Android和iOS平台的定位以及额外选择。创造一个名为build.settings的新文件,复制以下设置到这一文件中。
settings = {
orientation = {
default = “landscapeRight”,
supported = { “landscapeRight”, “landscapeLeft”}
iphone = {
UIStatusBarHidden = false,
UIAppFonts = { “Kemco Pixel.ttf” },
关于Corona SDK最棒的一点便是语言自文档化以及文件中大多数的设置都很容易理解。让我们快速浏览这些设置。
定位—-这一表格储存了游戏的真正外观。在我们的情况中,我们希望游戏是基于横向方式,并同时支持左右视角。
UIStatusBarHidden—-当我们在玩自己的游戏时,我们想要隐藏状态栏。所以我们将该选择设置为默认。
UIAppFonts—-这一选择让我们能够在应用中使用自定义字体,因为我们想要在应用中使用Kemco Pixel.ttf,所以我们便在此进行设置。字体文件必须放置在你的项目的根文件夹中。我们能在/kemco-pixel.font中下载到Kemco Pixel。
2.运行时间配置
当我们设置了创造时间配置后,我们将在config.lua文件中设置运行时间配置。在这一文件中,我们将设置游戏的宽度和高度,内容规范的类型以及每秒的帧率。创造一个名为config.lua的新文件并复制如下设置。
application = {
content = {
width = 320,
height = 480,
scale = “letterBox”,
与我们的build.settings文件一样的是,config.lua也是自文档化,除了规模选择外。规模选择是Corona SDK用于调整你的应用去面对不同屏幕尺寸的功能。在letterBox选择中,我们让Corona在保持纵横比的同时在屏幕上呈现所有的内容。当内容未能覆盖整个屏幕时,应用将在该区域呈现不带有任何内容的黑栏(就像基于宽屏的电影一样)。
在我们继续创造自己的应用前,我们需要说说图像。我们可以通过许多不同的方式将图像整合到游戏中,如聘请图像设计师,寻求朋友的帮助,独自绘制,或从http://graphicriver.net/等网站上购买相关图像。
然而,如果你的经费有限,你便不能购买这些图像,或者你可能也没时间去创造它们。在这种情况下,你可以使用基于创作共用授权而发行的图像。这些创作共用授权让你能够基于一些限制条件(如告知作者归因)而免费使用图像。
对于我们的游戏,我们将基于创作共用授权使用来自OpenGameArt.org的图像。这些图像的创造者是VividRealtiy,这是其作品的链接—-http://opengameart.org/content/evolutius-gfx-pack。在继续之前,请先确保你下载了图像设置或有关该教程的文件。
尽管还有许多基于该授权的图像网站,我经常访问的网站有三个:
http://www./freebies/
/blog/game-assets-for-corona-sdk
3.故事板设置
既然我们已经拥有了图像,我们便可以继续创造游戏了!为此我们需要创造一个名为main.lua的新文件。该文件将是我们游戏的起点,实际上它也是每款基于Corona的游戏的起点。一旦创造了文件,你可以在自己喜欢的编辑器上打开它,并输入如下代码:
display.setStatusBar( display.HiddenStatusBar )
这行代码将在iOS上隐藏状态栏。接下来我们将使用Corona的故事板功能去管理我们的游戏。故事板功能将突出游戏的两个部分作为场景,从而让开发者可以更轻松地管理代码。举个例子来说吧,我们的游戏拥有三个场景—-main.lua,菜单以及游戏屏幕。一旦设置了每个场景,Corona将提供一种简单的方式在不同场景间移动着。因为这对于那些刚开始使用Corona SDK的开发者而言可能是个巨大的障碍,所以我将呈现出我们游戏布局的图像解释:
每个蓝色框代表一个独立场景,而每个场景间的箭头呈现的是我们如何穿越场景。简单地来说,我们是从main.lua开始,并会在场景2和场景3之间来回移动。
在我们的应用中执行故事板非常简单:只需要模块便可,而你也已经准备就绪了!将以下代码放置在main.lua去整合这一伟大的功能。
– include the Corona “storyboard” module
local storyboard = require “storyboard”
接下来我们将要移动到第二个场景,我们将使用故事板变量去完成它。
storyboard.gotoScene( “menu” )
现在我们便完成了main.lua文件,让我们开始处理主菜单!
4.主菜单创造
我们游戏的主菜单将呈现背景图像,游戏名称以及开始游戏按键。一开始让我们先创造名为menu.lua的新文件和Corona所突出的故事板。
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
现在我们将添加Corona的小部件功能去创造按键。小部件功能让我们能够轻松地创造像游戏中的按键等常见的GUI元素。
local widget = require “widget”
在浏览了部件库之后,我们将为游戏预先定义一些变量。这些变量将储存屏幕狂赌,高度以及屏幕中标轴的中点。
local screenW, screenH, halfW, halfY = display.contentWidth, display.contentHeight, display.contentWidth*0.5, display.contentHeight*0.5
在设置了变量之后,我们将创造名为scene:createScene()的第一个函数。这一函数会在场景首次加载或者场景在之前被删除时进行调用。一般说来,这一函数是用于添加所有图像元素到屏幕上。
function scene:createScene( event )
local group = self.view
故事板的一个重要功能便是处理对象的方式。所有呈现我们在这一场景中使用的对象都将被放置在变量群组中。通过在这一群租中放置我们的对象,我们便能让Corona知道这些对象属于这一场景,而当需要删除场景时,这些对象也会被删除。
在函数scene:createScene()中,我们将使用图像BKG.png(游戏邦注:该图像是来自opengameart.org)作为游戏的背景图像。当添加了该图像后,我们将把它陈列在屏幕的中间,并将其整合到群组变量中。
– display a background image
local bg = display.newImageRect(“images/BKG.png”, 480, 320)
bg.x = halfW
bg.y = halfY
group:insert(bg)
接下来我们将使用自定义字体(我们在build.settings文件中所指定的)把游戏名字放置在屏幕上。
– place a game title on the screen
local gametitle = display.newText(“Space Defender”,0,0,”Kemco Pixel”,40)
gametitle.x = halfW
gametitle.y = 100
group:insert( gametitle )
最后添加到第一个函数中的便是游戏按键。游戏按键将使用Corona的小部件功能以及一个名为onPlayBtnRelease的事件侦听器。当用户碰触到游戏按键时,事件侦听器将被触发。以下代码都是在scene:createScene()函数中。
local function onPlayBtnRelease()
storyboard.gotoScene( “game”, “slideLeft”)
playBtn = widget.newButton{
label=”Play Now”,
labelColor = { default={255} },
defaultFile = “images/Button.png”,&& overFile = “images/Button_Purple.png”,
width=150, height=60,&& left=180, top=150,
font = “Kemco Pixel”,
fontSize = 18,&& onRelease = onPlayBtnRelease — event listener function
group:insert( playBtn )
在创造了场景函数后,我们将添加一个进入场景函数。该函数将在创造场景函数之后被触发,并删除之前的场景。
function scene:enterScene( event )
local group = self.view
if storyboard.getPrevious() ~= nil then
storyboard.removeScene(storyboard.getPrevious())
我们将添加的最后函数便是destroyScene函数。该函数将在场景被删除或被破坏时被调用。在我们的例子中,因为我们正在使用小部件,而小部件需要手动删除,所以我们将在破坏场景函数中删除小部件。
function scene:destroyScene( event )
local group = self.view
if playBtn then
playBtn:removeSelf()&&& — widgets must be manually removed
playBtn = nil
最后,我们将添加事件侦听器去调用我们所设置的不同函数—-enterScene,destroyScene以及createScene。
scene:addEventListener( “createScene”, scene )&& scene:addEventListener( “enterScene”, scene )&& scene:addEventListener( “destroyScene”, scene )
这便是本系列教程的第一部分!我们已经学会了如何设置项目,如何执行Corona的故事板功能,如何开始我们的应用,以及如何创造一个菜单系统了。
本文为游戏邦/编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦
Create a Space Defender Game – Game Setup
In this tutorial series, we will be learning how to create a space shooter game just like the classic game Space Defender. Read on!
In this version of Space Defender, the player will have to defend his space by shooting enemies. Every time the player successfully destroys an enemy, they will earn points and when the player has reached 20 or 40 points, their gun will receive an upgrade. To mix things up, this game will send out bonus packages that are worth 5 points. To see the game in action, watch the short video above. Now that we know more about the game we are creating, let’s get started!
This space shooter game will be built using the Corona SDK. Here are some of the things you’ll learn in this tutorial series:
A quick introduction to Corona’s Storyboard
How to utilizing artwork under the creative commons license
How to use custom fonts
How to use widgets such as buttons
How to build a full game with the Corona SDK
In order to use this tutorial, you’ll need to have the Corona SDK installed on your computer. If you do not have the SDK, head over to
to create a free account and download the free software.
1. Build Configuration
Our first step in setting up our game is the build.settings file. This file handles all of the build time properties of our app such as the orientation and additional options for Android and iOS platforms. Create a new file called build.settings and copy the following settings into your file.
settings = {
orientation = {
default = “landscapeRight”,
supported = { “landscapeRight”, “landscapeLeft”}
iphone = {
UIStatusBarHidden = false,
UIAppFonts = { “Kemco Pixel.ttf” },
One of the great things about Corona SDK is that the language self-documents and most of the settings in this file should be easy to understand. However, let’s quickly walk through these settings.
orientation – This table stores how the game will actually look. In our case, we want the game to be played in landscape mode and support both landscape left and right.
UIStatusBarHidden – Once we’re playing our game, we want to hide the status bar. So, we set this option to false.
UIAppFonts – This option allows us to use custom fonts within our app and since we want to use Kemco Pixel.ttf in our app, we set that here. The font file must be placed in the root folder of your project. Kemco Pixel is available for download at /kemco-pixel.font.
2. Runtime Configuration
After we’ve set our build time configurations, we are going to set up our runtime configurations in our config.lua file. In this file, we will set up the width and height of our game, the type of content scaling, and the frames per second. Create a new file called config.lua and copy the following settings.
application = {
content = {
width = 320,
height = 480,
scale = “letterBox”,
Similar to our build.settings file, the config.lua is self-documenting except for the scale option. The scale option is a feature that Corona SDK uses to adapt your application for different screen sizes. In the case of the letterBox option, we are telling Corona to display all of our content on the screen while keeping the aspect ratio.& When the content does not cover the entire screen, the app will display black bars in the areas without content (much like watching movies in widescreen mode).
Before we continue building our app, we need to talk about graphics. There are a lot of different ways that you can obtain graphics for your game – hire a graphic designer, hire a friend, draw them yourself, or even buy stock graphics from websites like http://graphicriver.net/.
However, if you are on a shoestring budget, you may not be able to purchase these graphics or you may not have the time to create them. In these kinds of situations, you can use graphics that have been released under the creative commons license. The creative commons license allows you to use graphics that are freely available under certain restrictions such as providing attribution to the author.
For our game, we are going to be using artwork under the creative commons license from OpenGameArt.org. The author that created these graphics is VividRealtiy and here’s a direct link to his work – http://opengameart.org/content/evolutius-gfx-pack. Before continuing, make sure to download the graphic set or download the file for this tutorial.
While there are a ton of websites with graphics under this license, here are three websites I visit often:
http://www./freebies/
/blog/game-assets-for-corona-sdk
Now that we have our graphics, we can continue making our game! To continue our game, we have to create a new file called main.lua. This file will be the start point of our game and in fact it’s the start point of every game made with Corona. Once the file is created, open it in your favorite editor and enter the following code:
display.setStatusBar( display.HiddenStatusBar )
This line of code will hide the status bar on iOS. Next, we will use Corona’s storyboard feature to manage our game. The storyboard feature treats different parts of the game as scenes to make it easier for developers to manage the code. For example, our game has three scenes – main.lua, the menu, and the game screen. Once each scene is set up, Corona provides a very easy way to move between scenes. Since this can be a huge hurdle for developers just starting with the Corona SDK, here’s a graphical representation of the layout of our game.
Each blue box represents an individual scene and the arrow between each scene shows how we will navigate through the scenes. Simply put, we start at main.lua and will navigate back and forth between Scene 2 and Scene 3.
Implementing the Storyboard in our app is simple: just require the module and you’re all set! Place the following code into main.lua to incorporate this great feature.
– include the Corona “storyboard” module
local storyboard = require “storyboard”
Next, we will want to move to the second scene and we will use the storyboard variable to accomplish this.
storyboard.gotoScene( “menu” )
Now that we’ve completed our main.lua file, let’s tackle the main menu!
The main menu of our game will display a background image, the game title, and a Play Now button. To get started, create a new file called menu.lua and Corona’s storyboard featured.
local storyboard = require( “storyboard” )
local scene = storyboard.newScene()
Now we will add Corona’s widget feature to create our button. The widget feature allows us to easily create common GUI elements such as buttons in our game.
local widget = require “widget”
After the widget library, we will pre-define some variables for our game. These variables will store the screen width, screen height, and the middle of the screen coordinates.
local screenW, screenH, halfW, halfY = display.contentWidth, display.contentHeight, display.contentWidth*0.5, display.contentHeight*0.5
After our variables, we will create our very first function called scene:createScene(). This function is called when the scene is loaded for the very first time or if the scene has been previously removed. Generally speaking, this function is used to add all of the graphical elements to the screen.
function scene:createScene( event )
local group = self.view
One important feature of a storyboard is the way it handles objects. All of the display objects that we use within this scene will be placed with the variable group. By placing our display objects within this group, we are letting Corona know that these objects belong to this scene and when the scene needs to be removed, these objects will also be removed.
Inside the function scene:createScene(), we will use the graphic BKG.png (this graphic came from opengameart.org) as the background for our game. Once it’s added, we will center the graphic on the screen and insert it into the group variable.
– display a background image
local bg = display.newImageRect(“images/BKG.png”, 480, 320)
bg.x = halfW
bg.y = halfY
group:insert(bg)
Next, we place our game title on the screen using the custom font that we specified in our build.settings file.
– place a game title on the screen
local gametitle = display.newText(“Space Defender”,0,0,”Kemco Pixel”,40)
gametitle.x = halfW
gametitle.y = 100
group:insert( gametitle )
Our last addition to our first function is the play button. The play button will use Corona’s widget feature and an event listener called onPlayBtnRelease. The event listener will be triggered when the play button is touched. Add the following code inside the scene:createScene() function.
local function onPlayBtnRelease()
storyboard.gotoScene( “game”, “slideLeft”)
playBtn = widget.newButton{
label=”Play Now”,
labelColor = { default={255} },
defaultFile = “images/Button.png”,&& overFile = “images/Button_Purple.png”,
width=150, height=60,&& left=180, top=150,
font = “Kemco Pixel”,
fontSize = 18,&& onRelease = onPlayBtnRelease — event listener function
group:insert( playBtn )
After our create scene function, we will add an enter scene function. This function will be triggered after the create scene function and will remove the previous scene.
function scene:enterScene( event )
local group = self.view
if storyboard.getPrevious() ~= nil then
storyboard.removeScene(storyboard.getPrevious())
The last function we will add is the destroyScene function. This function will be called when the scene is removed or destroyed. In our case, we are using widgets and since widgets must be removed manually, we remove the widget inside our destroy scene function.
function scene:destroyScene( event )
local group = self.view
if playBtn then
playBtn:removeSelf()&&& — widgets must be manually removed
playBtn = nil
Finally, we add event listeners to call the different functions we set up – enterScene, destroyScene, and createScene.
scene:addEventListener( “createScene”, scene )&& scene:addEventListener( “enterScene”, scene )&& scene:addEventListener( “destroyScene”, scene )
And that’s it for Part 1! We’ve learned how to set up our project, how to implement Corona’s storyboard feature, how to start our app, and how to create a menu system. Read Part 2 of this series now!(
已发表评论数()
请填写推刊名
描述不能大于100个字符!
权限设置: 公开
仅自己可见
正文不准确
标题不准确
排版有问题
主题不准确
没有分页内容
图片无法显示
视频无法显示
与原文不一致

我要回帖

更多关于 发明创造事例 的文章

 

随机推荐