Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Gideros Mobile Game Development
Gideros Mobile Game Development

Gideros Mobile Game Development: With Gideros you can develop games for both iOS and Android faster and more simply. This book shows you how with a real-life project you undertake yourself. All that's required is a little familiarity with Lua.

eBook
€8.99 €22.99
Paperback
€28.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Gideros Mobile Game Development

Chapter 2. Managing Scenes and Gideros OOP

Now that we know all the basics, let's create our own game. We will be creating a clone of a Mashballs game, a simple 2D physics puzzler, where the main objective of the game is to drag and launch the main ball in any direction to bounce and hit all other balls on the screen. You can find more information about the game and also download it from: http://jenots.com/mashballs.

We will use Gideros Object Oriented Programming (OOP) and create our own classes, which we will be using throughout the game. As well we will learn to manage multiple scenes and switch between them, and also how to store persistent information for our app.

The following are the topics we will be covering in this chapter:

  • Setting up our project

  • Introduction to Gideros OOP

  • Introduction to scene manager

  • Creating your own scenes with Gideros OOP

  • Creating a start screen for the game

  • Creating an options screen for the game

  • Storing persistent information

Setting up our project


Open up Gideros Studio and create a new project. Let's call it MashballsClone. While we are there, let's create the main.lua file for our initial code and also create the images folder to store our images in.

Just to make our project more maintainable, it is better to copy the files of the Gideros project in the same folders as you add them inside Gideros Studio. For example, create the images folder (and any other folder we will be creating) in your filesystem, and before you add images to Gideros project folder, copy them into the corresponding folder and only then add it in Gideros Studio. That way the structure will be the same for both Gideros project and your filesystem.

Now let's do the necessary settings. Right-click on the MashballsClone folder inside the Project pane and select Properties. Click on the iOS tab and select For iPhone and iPad as value for both Retina Display and Autorotation, which means we will support both iPads and iPhones with Retina display...

Creating scenes


Now we should have the main.lua and test.lua files in our project. The first one is empty, and the second one has our experiments with project settings. But note this, if we add some code to main.lua too, the code from both the files (main.lua and test.lua) will be executed. That is because Gideros automatically executes all added Lua files. This might be something new even to experienced Lua developers, as you won't require every file you want to use; and it provides a much more flexible approach in handling projects. But it also has its own limitations.

For example, if all the code is executed automatically, how should we separate different scenes, we want to use in our game, in a better way? Or in what order are the files executed? What if one file depends on another one?

By default, files are executed in the order they were added, but we can assume that the execution order is random and we should not rely on it. The correct way to manage a project is to divide all your...

Summary


We have successfully created the first working scenes of our game. In this chapter we learned how to create Gideros classes, by creating the Button and Settings class. Then we learned how to manage different scenes using Gideros OOP and scene manager. We also learned to use events and store information persistently.

In the next chapter we will start creating the game logic, including managing packs and level loading and unlocking, as well as adding the logic for running the game itself and creating a physics model for our objects.

Left arrow icon Right arrow icon

Key benefits

  • Develop engaging iOS and Android mobile games quickly and efficiently
  • Build your very first game following practical and easy-to-understand instructions
  • Full of code examples and descriptions to help you master the basics of mobile game development

Description

Have you ever had an interesting idea for a mobile game? Have you ever wanted to jump on the mobile app bandwagon? Developing a mobile game has never been so fun and easy, and with the vast amount of smartphone users, it may also become a profitable thing to do. Gideros is a Lua-based framework that facilitates effortless native iOS and Android application development along with hardware acceleration. Gideros also comes with a built-in box2D physics engine and extended memory management features to make mobile game development a breeze. Gideros Mobile Game Development shows you how to develop an original and exciting game in Gideros, helping you create your very first project and guiding you through the configuration of settings and assets to help you target devices with different resolutions. This book teaches you everything you need to know about Gideros, from installing Gideros on your operating system to creating and efficiently managing your Gideros projects and creating your very first game, all with the help of well explained examples. You will learn how to quickly create game prototypes in Gideros, how to test and set up projects to automatically target devices with different resolutions, and how to polish your prototype with animations, sounds, tweens, and even physics to create your very first cross-platform game. By the end of this book, you will have learned everything you need to create visually stunning physics and exciting cross-platform games using Gideros.

Who is this book for?

This book is for developers who are new to mobile game development or who have tried the native development of mobile games and want a simpler, faster tool that can support a wide variety of platforms and devices. Readers are expected to be at least partially familiar with the Lua game scripting language that Gideros uses for its scripts.

What you will learn

  • Install Gideros and set up one-click, on-device testing
  • Divide games into logical scenes for proper asset end memory management
  • Use the built-in physics engine inside Gideros
  • Implement pack, level, and level progression logic
  • Manage background music and sound effects
  • Use tweens and animations
  • Manage highscores for your players
Estimated delivery fee Deliver to Spain

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Nov 13, 2013
Length: 154 pages
Edition : 1st
Language : English
ISBN-13 : 9781849696708
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Spain

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Nov 13, 2013
Length: 154 pages
Edition : 1st
Language : English
ISBN-13 : 9781849696708
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 95.97
Mobile Game Design Essentials
€41.99
Gideros Mobile Game Development
€28.99
L÷VE for Lua Game Programming
€24.99
Total 95.97 Stars icon
Banner background image

Table of Contents

4 Chapters
Setting Up the Environment Chevron down icon Chevron up icon
Managing Scenes and Gideros OOP Chevron down icon Chevron up icon
Implementing Game Logic Chevron down icon Chevron up icon
Polishing the Game Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.8
(8 Ratings)
5 star 75%
4 star 25%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Shannon James May 19, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book does not waste time and gets right to the point. By the third day of reading, taking notes and coding, I felt WAY more comfortable programming with Lua in Gideros Mobile. What may have took me six to eight weeks to stumble upon through frantic Google searches and half baked You Tube videos, this book gave me in about two days! Gideros is a game engine that requires a lot of coding and planning. Not a lot of click and drag development. Bu this book really made it not only easy to understand, but really enjoyable. It answers a lot of questions about implementing classes and OOP logic in Gideros Mobile that I thought would go unanswered. It will give you the foundational knowledge you need to feel confidant about seeking out what more you can make Gideros Mobile do. If you have an idea for a multi platform game and are frustrated in finding a 2d Engine and book to help you fulfill your dreams, you have found the book. This book is an introduction book, not a complete desktop reference. However it will give you so much confidence that you can advance in the language (Lua) and game engine (Gideros) that you will feel emboldened to go on and create your own games. And most notably, all the code works fine. Despite being written about 7 years ago, the code actually goes off without a hiccup. Something I have not experienced yet in any book I have bought on game programming. I have been playing around with different programming languages and game engines for the last 5 years. I have been on the lookout for a game engine and book to help me in my pursuits. I must say that about halfway through most, my interest in them has faded. The books are not very comprehensive and create simple games that do not delve into the deeper aspects of the game engine. I was left with more questions than answers in almost all cases. This book has actually delivered what I wanted. I wish all game programming books took this approach. Hats off to the author. Thanks for a book that finally delivered what I wanted.
Amazon Verified review Amazon
Jason Oakley Dec 04, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Arturs has written a thorough and entertaining book on how to program for the Gideros platform. He elegantly covers all requirements to get you started on the road to making your own mobile games. All aspects of indie programming are covered from graphics to music and physics to managing your scenes. He goes into great detail explaining each section along the way and provides enough examples to help guide you to publishing your own game. Whether you are an absolute beginner or a seasoned professional, if you wish to learn the intricacies of the Gideros platform, this book has it all.Programming games and other applications for mobile platforms can seem very daunting at first. You need to keep in mind the differing platform requirements and App store restrictions. Mobile development needs to cover not only small mobile phones but also the larger tablet sized devices. You need to be able to cover a range of screen resolutions from 320x480 to over 1500x2000. Arturs effectively describes how it is possible to cover these dimensions to give your game the highest quality graphics and the best settings to cover all devices.The third chapter delves into demonstrations of Game Logic and optimising art. You will learn how to pack your textures for memory efficiency and speed as well as creating Level Packs for defining layouts for your game objects.A popular genre of mobile games are physics-enabled games. These include games such as Angry Birds and Mashballs (you will create a clone of this game while learning with this book). Arturs gives you example Lua code for developing your physics game and the caveats you need to be aware of to create your game successfully.You also need to be keenly aware of whether certain devices are touch-only or – in the case of Google’s Android – touch-and-buttons are used for input. Gideros Mobile Game Development covers each of these cases in chapter 4 and shows you how to get the best out of your application.Audio is very important when it comes to game development and sometimes not enough attention is paid to this particular vector when you are beginning your foray into mobile development. This book covers recommendations for audio file formats for background music and sound effects. Utilising the correct formats will ensure your game will be all it can be. Make sure you invest time in finding the best genre of music for your game.To complete your project, you will need to store and recover player high scores and other statistics. This gives your players the ability to compete for better game completion, bonuses and extends the longevity of the gameplay by lettings them try to achieve higher scores. Motivating your players with rewards provides a reason for them to keep coming back to your game.I highly recommend Gideros Mobile Game Development for anyone wanting to dip their virtual toes into the world of mobile development in a cheap (indeed, free) way. With this book, the support of the Gideros website forums and documentation, your development requirements will be complete. Even if you are a seasoned developer, you will find the Gideros platform useful for fast prototyping your games and will find this book invaluable.
Amazon Verified review Amazon
Boriska Mar 06, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you need a quick start creating your first Gideros game, go ahead and get this book. Arturs did a really great job, guiding it through the book through all the main steps of basic game development. He even introduced basic concepts of working with box2d. The book is short but it is worth every penny. The code in book is well commented and you can borrow a lot of techniques from there.Check Gideros community forum as well - people are really friendly there and ready to help. And you can be sure that when you post a question, Arturs will be normally the first one to reply!Well done, Arturs! Molodec!
Amazon Verified review Amazon
Javier Feb 10, 2014
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It's easy to rate this book with five stars, it has typos and minor mistakes but it contains a lot of useful information. In this book you'll find everything you need to make your first game and also a lot of tools to use in your next games.The information is presented in an incremental manner, so you're never managing more than one concept at a time. First you get a prototype stage, then you add game managing features like changing levels, menu displaying and things that make it seem more like a game, later on you add animation, sound and some user engaging features like high scores.Finally what you won't find here and you might be interested about are social integration, ads, and handling purchases.
Amazon Verified review Amazon
paolofranciej Dec 16, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I really love this book.Gideros is a great platform for creating mobile games, but for a beginner it isn't so easy to put everything together. Arturs is already one of the major contributors of useful information in the Goderos forums and on his blog, but in this book he covers in a structured form all the best practices to create a game from scratch incredible games.It's a tutorial to the n'th power ! Well written, well articulated, doesn't leave anything important unsaid or unclear...Absolutely a must for game programmers using Gideros! Or for would be mobile game programmers !I'm really happy with this book (when my 1M$ app hits the market I'll send him a gift for sure :) )
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela