Book Image

Gideros Mobile Game Development

By : Arturs Sosins
Book Image

Gideros Mobile Game Development

By: Arturs Sosins

Overview of this book

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.
Table of Contents (12 chapters)

Index

A

  • About button
    • creating, steps / Creating the start scene
  • about button / Creating the about scene
  • about scene
    • creating / Creating the about scene
  • AboutScene$init() method / Creating the about scene
  • AboutScene class / Creating the about scene
  • about This Game scene / Creating the about scene
  • addEventListener method / Creating our first class, Creating the start scene
  • add method / Adding sound effects
  • Add New File dialog / Trying out Gideros Studio
  • AlertDialog object / Completing the level
  • animated game elements
    • creating / Creating animated game elements
    • frame animations, creating with MovieClip / Frame animations using MovieClip
    • elements, tweening with GTween / Tweening elements with GTween
  • application$exit() method / Creating the start scene
  • application$getLogicalScaleX() method / Ignoring automatic scaling for positioning
  • application$getLogicalScaleY() method / Ignoring automatic scaling for positioning
  • application$getLogicalTranslateX() method / Ignoring automatic scaling for positioning
  • application $getLogicalTranslateY() method / Ignoring automatic scaling for positioning
  • automatic scaling
    • ignoring, for positions / Ignoring automatic scaling for positioning
  • Autorotation / Setting up our project

B

  • b2.DYNAMIC_BODY value / Creating physical bodies
  • b2.setScale(scale) method / Creating physical bodies
  • b2.STATIC_BODY constant / Setting up world boundaries
  • b2.STATIC_BODY value / Handling Box2D collisions
  • Back button / Creating the about scene, Creating LevelSelectScene
  • background music
    • adding / Adding background music
  • back variable / Ending with MouseUp
  • beginPath() method / Using texture packs inside project
  • BEGIN_CONTACT event / Updating high score on the screen
  • Bitmap class / Gideros OOP, Creating our first class
  • Bitmap object / Creating our first class, Creating the start scene, Using texture packs inside project, Creating physical bodies, Handling Box2D collisions, Generating a grid of levels, Switching between packs, Modifying code for selecting levels
  • bodyA.object$hit() method / Frame animations using MovieClip
  • bodyB property / Handling Box2D collisions
  • Box2D
    • about / Using physics in Gideros
  • Box2D collisions
    • handling / Handling Box2D collisions
  • button$setPosition(x,y) method / Creating our first class
  • Button class / Creating our first class, Creating the start scene, Using texture packs inside project, Modifying code for selecting levels
  • Button instance / Using texture packs inside project
  • Button object / Adding background music, Adding sound effects

C

  • ChainShape object / Setting up world boundaries
  • Change it button / Creating the settings class
  • changeScene method / Gideros scene manager, Creating a global configuration file
  • click event / Creating our first class, Adding sound effects
  • closeMenu() method / Using texture packs inside project
  • Code Dependencies / Creating the start scene
  • coding pane / Trying out Gideros Studio
  • conf.dx offset / Using texture packs inside project
  • conf.dy offset / Using texture packs inside project
  • config.dx variable / Using texture packs inside project
  • config.dy variable / Using texture packs inside project
  • Core.class() function / Creating our first class
  • Create directory for project option / Packing our textures
  • createLevel method / Adding high scores
  • curCol counter / Generating a grid of levels
  • currentX position / Generating a grid of levels
  • currentY position / Generating a grid of levels

D

  • dataSaver module / Creating the settings class
  • DebugDraw layer / Using physics in Gideros
  • Deftone Stylus / Creating the start scene
  • device player installation
    • Android player, installing / Installing the Android player
    • iOS player, installing / Installing the iOS player
    • project, running / Running the project on a device player
  • dispatchEvent method / Creating our first class
  • Documents directory / Creating the settings class, Creating the GameManager class

E

  • e$stopPropagation() method / Using texture packs inside project
  • elements
    • tweening, GTween used / Tweening elements with GTween
  • endPath() method / Using texture packs inside project
  • ENTER_FRAME event / Running the world, Interaction with physical bodies, Implementing Mashballs magnet
  • event$stopPropagation() method / Creating our first class, Starting with MouseDown
  • EventDispatcher class / Creating our first class, Adding background music
  • event listeners
    • adding / Adding event listeners
  • Event object / Creating our first class
  • Export Project dialog / Exporting Gideros project
  • Export Project option / Exporting Gideros project

F

  • Filling Ipad zone / Ignoring automatic scaling for positioning
  • first project
    • creating / Trying out Gideros Studio, Using the Gideros desktop player, Displaying graphical objects in Gideros Player, Managing project settings, Installing the device player, Exporting Gideros project
  • frame animations
    • creating, MovieClip used / Frame animations using MovieClip

G

  • GameManager$createLevel method / Adding high scores
  • GameManager$setScore method / Updating high score on the screen
  • GameManager class
    • creating / Creating the GameManager class
    • about / Creating the GameManager class, Implementing unlocked levels logic
    / Implementing unlocked levels logic, Adding high scores
  • GameManager method / Adding high scores
  • gameplay
    • improving / Improving gameplay
  • gameplay improvement
    • level packs, changing with swipe gesture / Changing level packs by using the swipe gesture, Continue with MouseMove, Ending with MouseUp, Modifying code for selecting levels
    • Mashballs magnet, implementing / Implementing Mashballs magnet
  • Gideros
    • about / About Gideros
    • features / About Gideros
    • installling / Installing Gideros
    • installing, on Windows / Installing Gideros on Windows
    • installing, on Linux / Installing Gideros on Linux
    • physics, using in / Using physics in Gideros
    • physical bodies, creating / Creating physical bodies
    • physics world, running / Running the world
    • physics world boundries, setting up / Setting up world boundaries
    • physical bodies, interacting with / Interaction with physical bodies
    • Box2D collisions, handling / Handling Box2D collisions
  • Gideros class
    • creating / Creating our first class
  • Gideros desktop player
    • using / Using the Gideros desktop player
  • Gideros installation
    • software packages / Installing Gideros
    • system requirements / Requirements
    • on Windows / Installing Gideros on Windows
    • on Mac OS X / Installing Gideros on Mac OS X
    • on Linux / Installing Gideros on Linux
  • Gideros OOP
    • about / Gideros OOP
  • Gideros Player
    • graphical objects, displaying in / Displaying graphical objects in Gideros Player
  • Gideros project
    • exporting / Exporting Gideros project
  • Gideros scene manager
    • using / Gideros scene manager
    • URL / Gideros scene manager
  • Gideros Studio
    • trying out / Trying out Gideros Studio
    • panes / Trying out Gideros Studio
    • coding pane / Trying out Gideros Studio
  • GiderosTexturePacker / Packing our textures
  • global configuration file
    • creating / Creating a global configuration file
  • gotoAndPlay method / Frame animations using MovieClip
  • graphical objects, displaying in Gideros Player
    • about / Displaying graphical objects in Gideros Player
    • text, displaying / Displaying text
    • images, displaying / Displaying images
    • shapes, drawing / Drawing shapes
    • Sprite class, using / Using the Sprite class for groups and layers
  • Graphics tab / Input settings, Setting up our project
  • GTween
    • used, for elements tweening / Tweening elements with GTween
    • URL / Tweening elements with GTween
  • GTween class / Tweening elements with GTween

H

  • high scores
    • adding / Adding high scores
    • retrieving / Retrieving high scores
    • updating, on screen / Updating high score on the screen
  • highScore variable / Retrieving high scores
  • hitTestPoint method / Creating our first class

I

  • init method / Creating our first class, Creating the start scene, Creating the settings class, Implementing the main game scene, Using physics in Gideros, Creating physical bodies, Running the world, Creating LevelSelectScene, Creating the GameManager class, Implementing unlocked levels logic, Adding background music
  • Input tab / Input settings, Setting up our project
  • IntelliJ IDEA / Creating your first project
  • iOS tab / Setting up our project
  • isDragged flag / Interaction with physical bodies

K

  • KeyCode.BACK constant / Creating the start scene
  • KEY_DOWN event / Creating the start scene, Implementing the main game scene

L

  • level definitions
    • reading / Reading level definitions
  • levelNumber / Generating a grid of levels
  • level packs
    • changing, swipe gesture used / Changing level packs by using the swipe gesture
  • level packs modifications, swipe gesture used
    • MouseDown, starting with / Starting with MouseDown
    • MouseMove, continuing with / Continue with MouseMove
    • MouseUp, ending with / Ending with MouseUp
    • event listeners, adding / Adding event listeners
    • Previous Code, modifying / Modifying code for selecting levels
  • levels
    • managing / Managing packs and levels
    • LevelSelectScene, creating / Creating LevelSelectScene
    • grid, generating / Generating a grid of levels
    • GameManager class, creating / Creating the GameManager class
    • unlocked levels logic, implementing / Implementing unlocked levels logic
    • definition, reading / Reading level definitions
    • completing / Completing the level
  • LevelScene$back() method / Implementing the main game scene
  • LevelScene$closeMenu() method / Using texture packs inside project
  • LevelScene$complete() method / Updating high score on the screen
  • LevelScene$completed() method / Completing the level, Adding sound effects
  • LevelScene$createMenu() method / Using texture packs inside project
  • LevelScene$ init() method / Using texture packs inside project
  • LevelScene$init() method / Implementing the main game scene, Using texture packs inside project, Using physics in Gideros, Running the world, Setting up world boundaries, Handling Box2D collisions, Implementing unlocked levels logic, Reading level definitions, Adding high scores, Implementing Mashballs magnet
  • LevelScene$onBeginContact () method / Handling Box2D collisions
  • LevelScene$onEnterFrame event / Running the world
  • LevelScene$onEnterFrame method / Running the world
  • LevelScene class / Implementing the main game scene, Tweening elements with GTween
  • LevelScene instance / Creating physical bodies
  • LevelScene option / Packing our textures
  • LevelSelectScene
    • onEnterEnd() method / Adding event listeners
  • levelselect scene / Creating LevelSelectScene, Creating the GameManager class, Implementing unlocked levels logic
  • LevelSelectScene$init() method / Switching between packs, Adding event listeners
  • LevelSelectScene$nextPack() method / Switching between packs
  • LevelSelectScene$prevPack() method / Switching between packs
  • LevelSelectScene class
    • creating / Creating LevelSelectScene
  • levels grid
    • generating / Generating a grid of levels
    • screenshot / Generating a grid of levels
  • Linux
    • Gidero, installing on / Installing Gideros on Linux
  • loadPack() method / Creating the GameManager class
  • LuaGlider / Creating your first project

M

  • $methodName() method / Gideros OOP
  • Mac OS X
    • Gidero, installing on / Installing Gideros on Mac OS X
    • installing, on Linux / Installing Gideros on Mac OS X
  • magnetStarted property / Implementing Mashballs magnet
  • MainBall$createBody() method / Interaction with physical bodies
  • MainBall$init() method / Creating physical bodies, Interaction with physical bodies, Implementing Mashballs magnet
  • MainBall$onEnterFrame() method / Implementing Mashballs magnet
  • MainBall$smile() method / Handling Box2D collisions
  • MainBall class / Creating physical bodies, Handling Box2D collisions, Implementing Mashballs magnet
  • MainBall object / Creating physical bodies
  • main game scene
    • implementing / Implementing the main game scene
    • texture packs, using / Using texture packs
    • textures, packing / Packing our textures
    • texture packs, using inside project / Using texture packs inside project
  • MashballsClone project
    • setting up / Setting up our project, Handling scaled graphics with AutoScaling, Handling whitespaces, Ignoring automatic scaling for positioning
    • about / Setting up our project
    • scaled graphics, handling with AutoScaling / Handling scaled graphics with AutoScaling
    • whitespaces, handling / Handling whitespaces
    • position automatic scaling, ignoring / Ignoring automatic scaling for positioning
  • Mashballs magnet
    • implementing / Implementing Mashballs magnet
  • mouse input events
    • Event.MOUSE_UP / Creating our first class
    • Event.MOUSE_DOWN / Creating our first class
    • Event.MOUSE_MOVE / Creating our first class
  • MOUSE_DOWN event / Creating our first class, Interaction with physical bodies
    • starting with / Starting with MouseDown
  • MOUSE_MOVE event / Interaction with physical bodies
    • continuing with / Continue with MouseMove
  • MOUSE_UP event / Creating our first class, Interaction with physical bodies
    • ending with / Ending with MouseUp
  • MovieClip
    • used, for frame animations creating / Frame animations using MovieClip
  • MovieClip.new() method / Frame animations using MovieClip
  • MovieClip instance / Frame animations using MovieClip
  • MovieClip object / Frame animations using MovieClip
  • Music$off() method / Adding background music
  • Music$on() method / Adding background music
  • Music class / Adding background music, Adding sound effects
  • musicOff event / Adding background music
  • musicOn event / Adding background music

N

  • .new() method / Gideros OOP
  • New Project dialog / Packing our textures
  • nextPack() method / Switching between packs

O

  • onBeginContact instant / Updating high score on the screen
  • onBeginContact method / Adding sound effects, Updating high score on the screen, Frame animations using MovieClip, Tweening elements with GTween
  • onEnterEnd() method / Adding event listeners
  • onEnterFrame event / Running the world
  • onEnterFrame method / Implementing Mashballs magnet
  • onMouseDown method / Interaction with physical bodies
  • onMouseMove method / Interaction with physical bodies
  • onMouseUp method / Creating our first class, Interaction with physical bodies
  • onPostSolve event / Updating high score on the screen
  • onPostSolve method / Updating high score on the screen
  • Options button / Creating the start scene
  • options scene
    • creating / Creating the options scene
  • OptionsScene class / Creating the options scene
  • Options screen / Adding sounds, Adding background music
  • Output pane / Using the Gideros desktop player, Displaying text, Creating our first class, Creating the about scene

P

  • packed texture
    • screenshot / Packing our textures
  • packs
    • managing / Managing packs and levels
    • defining / Defining packs
    • switching between / Switching between packs
  • panes / Trying out Gideros Studio
  • physical bodies
    • creating / Creating physical bodies
    • interacting with / Interaction with physical bodies
  • physics
    • using, in Gideros / Using physics in Gideros
  • physics world
    • running / Running the world
    • boundries, setting up / Setting up world boundaries
  • physics world boundries
    • setting up / Setting up world boundaries
  • Player menu / Running the project on a device player
  • POST_SOLVE event / Updating high score on the screen
  • Previous Code
    • modifying / Modifying code for selecting levels
  • prevPack() method / Switching between packs
  • Project pane / Trying out Gideros Studio, Setting up our project, Creating scenes, Gideros OOP, Gideros scene manager, Packing our textures
  • Project Properties dialog / Automatic scaling
  • project settings
    • managing / Managing project settings
    • automatic scaling / Automatic scaling
    • automatic image resolution / Automatic image resolution
    • input settings / Input settings
    • iOS-specific settings / iOS-specific settings

R

  • Resource directory / Creating the settings class
  • Resume button / Using texture packs inside project
  • Retina Display / Setting up our project

S

  • Save button / Creating the settings class
  • save method / Creating the settings class
  • scaled graphics
    • handling, AutoScaling used / Handling scaled graphics with AutoScaling
  • SceneManager.moveFromLeft transition / Switching between packs
  • SceneManager.moveFromRight transition / Switching between packs
  • SceneManager constructor / Gideros scene manager
  • SceneManager instance / Gideros scene manager
  • sceneManager instance / Creating the about scene, Implementing the main game scene
  • scenes
    • creating / Creating scenes
    • Gideros OOP / Gideros OOP
    • Gideros class, creating / Creating our first class
    • Gideros scene manager / Gideros scene manager
    • global configuration file, creating / Creating a global configuration file
    • start scene, creating / Creating the start scene
    • about scene, creating / Creating the about scene
    • options scene, creating / Creating the options scene
    • settings class, creating / Creating the settings class
  • scenes directory / Implementing the main game scene
  • self$nextPack() method / Ending with MouseUp
  • self$prevPack() method / Ending with MouseUp
  • self.ballsLeft property / Reading level definitions, Completing the level
  • self.body$applyLinearImpulse method / Interaction with physical bodies
  • self.g property / Using texture packs inside project
  • self.g variable / Using texture packs inside project
  • self.initX property / Ending with MouseUp
  • self.isChanged property / Creating the settings class
  • self.isFocus flag / Continue with MouseMove, Ending with MouseUp
  • self.isFocus property / Starting with MouseDown
  • self.isOn flag / Adding sound effects
  • self.level instance property / Creating physical bodies
  • self.level property / Implementing Mashballs magnet
  • self.magnetStarted flag / Implementing Mashballs magnet
  • self.magnetStart property / Implementing Mashballs magnet
  • self.mainBall property / Implementing Mashballs magnet
  • self.menu property / Using texture packs inside project
  • self.packs property / Creating the GameManager class
  • self.paused flag / Using texture packs inside project
  • self.score property / Updating high score on the screen
  • self.scoreText object / Updating high score on the screen
  • self.scoreText variable / Retrieving high scores
  • self.score variable / Retrieving high scores
  • self.world$step() method / Running the world
  • self variable / Creating our first class
  • setAlpha() method / Creating our first class
  • setPosition() method / Creating our first class
  • setText method / Creating the settings class
  • settings class
    • creating / Creating the settings class
  • Settings class / Creating the options scene, Creating the settings class, Creating LevelSelectScene, Switching between packs, Creating the GameManager class, Completing the level, Adding sound effects
  • shakeScreen method / Tweening elements with GTween
  • shape
    • physical properties / Creating physical bodies
  • shape*closePath() method / Drawing shapes
  • shape*endPath() method / Drawing shapes
  • Shape class / Creating our first class, Setting up world boundaries
  • Shape instance / Using texture packs inside project
  • Shape object / Using texture packs inside project
  • show method / Creating the settings class
  • smile() method / Handling Box2D collisions
  • software packages, Gideros installation
    • Gideros Studio / Installing Gideros
    • Gideros Player / Installing Gideros
    • Gideros Texture Packer / Installing Gideros
    • Gideros Font Creator / Installing Gideros
    • Gideros License Manager / Installing Gideros
  • sound$play() method / Adding sounds
  • Sound class / Adding sounds
  • sound effects
    • adding / Adding sound effects
    • complete sound effects / Adding sound effects
    • hit sound effects / Adding sound effects
  • Sound object / Adding background music, Adding sound effects
  • sounds
    • adding / Adding sounds
    • background music, adding / Adding background music
    • sound effects, adding / Adding sound effects
  • Sounds$init() method / Adding sound effects
  • Sounds class / Adding sound effects
  • Sounds instance / Adding sound effects
  • soundsOff event / Adding sound effects
  • soundsOn event / Adding sound effects
  • sounds option / Adding sound effects
  • Sprite class / Gideros OOP, Creating our first class
  • sprite instance / Gideros OOP
  • Sprite object / Creating our first class, Gideros scene manager, Running the world
  • sprite object / Tweening elements with GTween
  • stage class / Creating our first class
  • startButton event / Creating LevelSelectScene
  • Start Game button / Creating the start scene, Implementing the main game scene, Creating physical bodies, Creating LevelSelectScene
  • start scene
    • creating / Creating the start scene
  • StartScene init method / Gideros scene manager
  • startX property / Modifying code for selecting levels
  • strength variable / Interaction with physical bodies
  • Sublime / Creating your first project
  • swipe gesture
    • used, for level packs changing / Changing level packs by using the swipe gesture
  • swipe gesture used
    • MouseUp, ending / Ending with MouseUp

T

  • Temp directory / Creating the settings class
  • TextField class / Creating the about scene, Creating the settings class
  • TextField object / Creating our first class, Creating the start scene, Creating the about scene, Creating LevelSelectScene, Generating a grid of levels, Adding background music, Adding sound effects, Retrieving high scores
  • TextInputDialog instance / Creating the settings class
  • Texture.new( / Gideros OOP
  • Texture class / Gideros OOP, Using texture packs
  • TexturePack class / Packing our textures, Using texture packs inside project
  • Texture Packer window / Packing our textures
  • texture packs
    • using / Using texture packs
    • downsides / Using texture packs
    • using, inside project / Using texture packs inside project
  • texturepacks directory / Packing our textures, Using texture packs inside project
  • textures
    • packing / Packing our textures
  • TextWrap class
    • URL / Creating the about scene
    • using / Creating the about scene
  • TextWrap instance
    • creating, steps / Creating the about scene
  • Timer.delayedCall function / Handling Box2D collisions
  • TouchBall$createBody() method / Handling Box2D collisions
  • TouchBall class / Handling Box2D collisions
  • TouchBall object / Handling Box2D collisions
  • touches events
    • Event.TOUCHES_MOVE / Creating our first class
    • Event.TOUCHES_BEGIN / Creating our first class
    • Event.TOUCHES_END / Creating our first class
  • TrueType Font file / Creating the start scene
  • TTFont object / Creating the start scene
  • Turn off text / Adding background music
  • Turn on text / Adding background music
  • tweening
    • about / Tweening elements with GTween

U

  • unlocked flag / Creating the GameManager class
  • unlocked levels logic
    • implementing / Implementing unlocked levels logic
  • unlocked property / Creating the GameManager class
  • usernameText field / Creating the settings class

W

  • whitespaces
    • handling / Handling whitespaces
  • Windows
    • Gidero, installing on / Installing Gideros on Windows
  • world$createBody method / Creating physical bodies
  • world$step() method / Running the world, Interaction with physical bodies

X

  • xVect vector / Interaction with physical bodies

Y

  • yVect vector / Interaction with physical bodies

Z

  • ZeroBrane / Creating your first project