Create Mobile Games with Corona: Build with Lua on iOS and Android

0
(0)

Create Mobile Games with Corona: Build with Lua on iOS and Android
 

  • Author:Silvia Domenech
  • Length: 248 pages
  • Edition: 1
  • Publisher: Pragmatic Bookshelf
  • Publication Date: 2013-11-10
  • ISBN-10: 1937785572
  • ISBN-13: 9781937785574
  • Sales Rank: #3727170 (See Top 100 Books)
  • Download:Register/Login to Download
  • Buy Print:Buy from amazon


    Book Description

    Develop cross-platform mobile games with Corona using the Lua programming language! Corona is experiencing explosive growth among mobile game developers, and this book gets you up to speed on how to use this versatile platform. You’ll use the Corona SDK to simplify game programming and take a fun, no-nonsense approach to write and add must-have gameplay features. You’ll find out how to create all the gaming necessities: menus, sprites, movement, perspective and sound effects, levels, loading and saving, and game physics. Along the way, you’ll learn about Corona’s API functions and build three common kinds of mobile games from scratch that can run on the iPhone, iPad, Kindle Fire, Nook Color, and all other Android smartphones and tablets.

    Get a crash course in cross-platform mobile game programming using the Corona SDK. Corona, one of the easiest to use mobile gaming platforms, makes this often-difficult process both quick and easy to master.

    Even if you have little previous programming knowledge, you’ll feel comfortable as we begin with fundamentals before building examples of the most common kinds of games on the market today. You’ll develop arcade, side scroller, and tower defense games from start to finish, and Corona will automatically turn them into apps that can run on both iOS and Android devices. These finished apps can be used as ready-to-go frameworks for your own future projects. You’ll learn how to write clean, easily maintainable, easily expandable game code, and to create online leaderboards for your games. You’ll also find out how to make money with games: enabling in-app purchases and in-game ads as well as how to get apps into the iTunes App Store, Google Play, and the Amazon Android Marketplace.

    This book focuses on getting quick and effective results. Every page teaches by example and explanation, not with abstract lists of functions and variables. By the time you’re done, you’ll have learned most of what there is to know about mobile game programming and about the Corona SDK.

    Q&A with Silvia Domenech, author of Create Mobile Games with Corona

    Q. Why did you write Create Mobile Games with Corona?

    A. When I started programming, I had access to lots of books for traditional programmers that taught the basics (loops, classes, etc.), but then they moved on to topics that aren’t really necessary for game development. I wanted to make games, so learning how to code yet another phone agenda or scheduling application wasn’t really interesting to me.

    I did read game programming books, but many of them felt like university lectures: Here’s a detailed description of the theory; learn to apply it by yourself. Good luck. That was really frustrating, and it made learning slower than reading online forums that had applied examples.

    Many years later, I stumbled upon a Pragmatic book, and I instantly fell in love with it. I thought, “If somebody uses this style to write about game programming, everyone will be able to learn!”

    I waited, and waited, and waited, but no Pragmatic game programming books appeared. During my wait, a few friends and acquaintances asked me how they could learn to make games, and I couldn’t point them to a hands-on resource. I decided to write the book then, in order to help my friends and anyone else who wanted to learn to code games with Corona.

    Mobile games are really popular right now, so it is great to be able to teach how to code games using an easy-to-learn engine like the Corona SDK.

    Q. What does Corona offer mobile developers that other systems don’t offer?

    A. First of all, Corona makes coding very quick and easy. Many programming languages require you to use extra libraries (or write your own code) to handle common game-related functions such as sprite management or collision detection. Coders can write one or two lines of code to get many game-related things done in Corona, so it really reduces development time.

    Corona also comes with lots of resources: documentation, tutorials, and even forums. This is great, because it means that you won’t be alone when coding. Have you found a bug in the Corona compiler? Somebody may have posted about it in the forums. Do you want to code something but it doesn’t work? See if there’s a walkthrough for it. Other languages don’t have so many resources.

    Apart from those two advantages, Corona makes it easy to port an iOS game to Android or vice versa. Writing game code twice to use it on two platforms can be boring, and Corona solves this by giving us developers an environment that builds on both iOS and Android.

    Q. What kind of games would I be able to make with this book?

    Ideally, this book will teach you the basics of Corona so that you can move on to make any game you like. Since we’re making games from the start, we’ll learn how to load and draw images, make them move, and interact with them. Then we’ll move on to more complex topics, like making units find their way around the screen, adding sound effects, and loading and saving data.

    The book is divided into several projects so that you can work on more than one game from scratch. You can make a planet defense game, a vertical-scrolling shooter, a tower defense game with pathfinding algorithms, and a physics-based app with advertising and in-app purchase options. That’s roughly the core toolset that any aspiring game programmer will need.

    Q. What do you suggest I look at next after this book?

    I suggest looking at furniture catalogues to find a comfortable chair to sit on! Oh, you already have one of those? Great! Then you’re ready to learn some advanced game development topics, such as advanced physics, multiplayer games, and even game balancing.

    To learn physics, you can take a look at the Box2D documentation (it’s the physics engine used in Corona). You can learn about gravity, velocities, different types of collision handling, constraints, and many other topics that can let you make complex physics-based games.

    Once you start making games, if you haven’t already made games in other languages, you might also need to get used to game balancing. It’s important to make games challenging but not too challenging, and learning how to balance your games will help you along the way.

    If you want to take your learning to the next level, you can look for books or resources on multiplayer game programming. The good part about multiplayer programming is that you can code the server using any language. I personally code many of my multiplayer servers using Java, which makes it quick and easy to code a server from scratch. Corona lets you open sockets to communicate with a server, so it can be lots of fun to make anything ranging from a multiplayer version of tic-tac-toe to a complex MMO. I’d suggest starting with tic-tac-toe or another simple game, though!

    Table of Contents

    Part I: Getting Started
    Chapter 1. Hello, Corona!

    Part II: Planet Defender
    Chapter 2. The Game Loop
    Chapter 3. Sprites and Movement
    Chapter 4. Input and Menus

    Part III: Vertical-Scrolling Shooter
    Chapter 5. Representing Movement and Perspective
    Chapter 6. Adding Shooting, Collisions, and Power-Ups
    Chapter 7. Adding Sound

    Part IV: Tower Defense
    Chapter 8. Displaying Maps and Sorting Depths
    Chapter 9. Adding Movement and Artificial Intelligence
    Chapter 10. Loading and Saving

    Part V: Physics and Distribution
    Chapter 11. Physics and the Accelerometer
    Chapter 12. Publishing Our Apps

    Appendix A1. Corona Resources
    Appendix A2. Classes in Corona

    中文:

    书名:Create Mobile Games with Corona: Build with Lua on iOS and Android

    使用Lua编程语言开发具有Corona的跨平台手机游戏!Corona在手机游戏开发商中经历了爆炸性的增长,这本书让你快速了解如何使用这个多功能的平台。您将使用Corona SDK简化游戏编程,并以一种有趣、严肃的方式编写和添加必备的游戏功能。您将了解如何创建所有游戏必需品:菜单、精灵、移动、透视和音效、关卡、加载和保存以及游戏物理。在这个过程中,你将了解Corona的API函数,并从零开始构建三种常见的手机游戏,可以在iPhone、iPad、Kindle Fire、Nook Color和所有其他Android智能手机和平板电脑上运行。

    使用Corona SDK获得跨平台手机游戏编程的速成课程。Corona是最容易使用的移动游戏平台之一,它使这个往往困难的过程既快又容易掌握。

    即使你以前几乎没有编程知识,你也会感觉很舒服,因为我们先从基础开始,然后再构建当今市场上最常见的游戏类型的示例。你将从头到尾开发街机游戏、侧滚游戏和塔防游戏,而Corona会自动将它们变成可以在iOS和Android设备上运行的应用程序。这些已完成的应用程序可以作为您自己未来项目的即用框架。您将学习如何编写干净、易于维护、易于扩展的游戏代码,以及如何为您的游戏创建在线排行榜。你还将了解如何通过游戏赚钱:实现应用内购买和游戏内广告,以及如何将应用程序带入iTunes应用商店、Google Play和亚马逊Android Marketplace。

    这本书的重点是获得快速有效的结果。每一页都是通过例子和解释进行教学,而不是用抽象的函数和变量列表。当你完成的时候,你将已经了解了关于手机游戏编程和关于Corona SDK的大部分知识。

    与西尔维娅·多梅内克(Silvia Domeech)问答 使用Corona创建手机游戏

    问:你为什么要写 使用Corona创建手机游戏?

    答:当我开始编程时,我可以接触到许多面向传统程序员的书籍,这些书籍教授基础知识(循环、类等),但后来他们转向了游戏开发并不真正必要的主题。我想做游戏,所以学习如何编写另一个电话日程或日程安排应用程序对我来说并不是真的很有趣。

    我确实读过游戏编程书籍,但其中许多都感觉像是大学讲座: 以下是对这一理论的详细描述;学会自己应用它。祝好运。 这真的很令人沮丧,而且它让学习变得比阅读应用了例子的在线论坛更慢。

    许多年后,我偶然发现了一本实用的书,我立刻爱上了它。我想,如果有人用这种风格来写游戏编程,每个人都能学到!

    我等了又等,但没有一本实用的游戏编程书籍出现。在我等的过程中,几个朋友和熟人问我如何才能学会制作游戏,我无法向他们提供实际操作的资源。当时我决定写这本书,以帮助我的朋友和其他任何想要和科罗娜一起学习编写游戏代码的人。

    手机游戏现在非常流行,所以能够教授如何使用像Corona SDK这样易于学习的引擎来编写游戏代码是一件很棒的事情。

    问:Corona为移动开发人员提供了哪些其他系统无法提供的功能?

    答:首先,Corona让编程变得非常快捷和容易。许多编程语言要求您使用额外的库(或编写您自己的代码)来处理常见的与游戏相关的功能,如精灵管理或冲突检测。程序员可以在Corona中编写一两行代码来完成许多与游戏相关的事情,因此它确实减少了开发时间。

    Corona还提供了大量资源:文档、教程,甚至论坛。这很棒,因为这意味着您在编写代码时不会孤单。您在Corona编译器中发现错误了吗?可能有人在论坛上发布了这件事。您想编写一些代码,但它不起作用吗?看看有没有可以走动的地方。其他语言没有这么多资源。

    除了这两个优势外,Corona还可以轻松地将iOS游戏移植到Android上,反之亦然。编写两次游戏代码在两个平台上使用可能会很无聊,而Corona通过为我们的开发人员提供一个同时基于iOS和Android的环境来解决这个问题。

    问:我能用这本书做什么样的游戏?

    理想情况下,这本书将教你科罗纳的基础知识,这样你就可以继续制作任何你喜欢的游戏。因为我们从一开始就制作游戏,所以我们将学习如何加载和绘制图像、使它们移动以及与它们交互。然后,我们将转到更复杂的主题,比如让单元在屏幕上找到它们的方向,添加音效,以及加载和保存数据。

    这本书被分成几个项目,这样你就可以从头开始研究不止一个游戏。你可以制作一款行星防御游戏,一款垂直滚动射击游戏,一款带有寻路算法的塔防游戏,以及一款带有广告和应用内购买选项的基于物理的应用程序。这大概是任何有抱负的游戏程序员都需要的核心工具集。

    问:在这本书之后,你建议我接下来看什么?

    我建议看看家具目录,找一把舒服的椅子坐在上面!哦,你已经有一个了?太棒了!然后,您将学习一些高级游戏开发主题,例如高级物理、多人游戏,甚至游戏平衡。

    要学习物理,您可以查看Box2D文档(它是Corona中使用的物理引擎)。您可以了解重力、速度、不同类型的碰撞处理、约束和许多其他主题,这些主题可以让您制作复杂的基于物理的游戏。

    一旦你开始制作游戏,如果你还没有用其他语言制作游戏,你可能也需要习惯游戏平衡。让游戏变得具有挑战性是很重要的,但不要太具挑战性,学习如何平衡你的游戏将帮助你一路走来。

    如果你想让你的学习更上一层楼,你可以寻找关于多人游戏编程的书籍或资源。多人编程的好处是您可以使用任何语言编写服务器代码。我亲自使用Java对我的许多多人服务器进行编码,这使得从头开始编写服务器变得又快又容易。Corona允许你打开套接字与服务器通信,所以制作从多玩家版本的tic-tac-toe到复杂的MMO的任何东西都会非常有趣。不过,我还是建议从Tic-Tac-Toe或其他简单游戏开始!

    Table of Contents

    第一部分:入门
    Chapter 1. Hello, Corona!

    第二部分:星球捍卫者
    Chapter 2. The Game Loop
    第三章:精灵与运动
    Chapter 4. Input and Menus

    第三部分:垂直卷轴射击
    第五章.表现运动和视角
    Chapter 6. Adding Shooting, Collisions, and Power-Ups
    第7章.添加声音

    第四部分:铁塔防御
    第8章.显示地图和排序深度
    第九章:添加运动和人工智能
    第十章.加载和保存

    Part V: Physics and Distribution
    第十一章:物理学与加速度计
    第12章.发布我们的应用程序

    Appendix A1. Corona Resources
    Appendix A2. Classes in Corona

  • 下载电子版:下载地址
  • 购买纸质版:亚马逊商城

    点击星号评分!

    平均分 0 / 5. 投票数: 0

    还没有投票!请为他投一票。

  • 推荐阅读

    评论 抢沙发

    评论前必须登录!

     

    登录

    找回密码

    注册