Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Corona SDK Mobile Game Development: Beginner's Guide

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product type Book
Published in Mar 2015
Publisher
ISBN-13 9781783559343
Pages 372 pages
Edition 1st Edition
Languages
Author (1):
Michelle M Fernandez Michelle M Fernandez
Profile icon Michelle M Fernandez

Table of Contents (19) Chapters

Corona SDK Mobile Game Development Beginner's Guide Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Getting Started with Corona SDK 2. Lua Crash Course and the Corona Framework 3. Building Our First Game – Breakout 4. Game Controls 5. Animating Our Game 6. Playing Sounds and Music 7. Physics – Falling Objects 8. Operation Composer 9. Handling Multiple Devices and Networking Your Apps 10. Optimizing, Testing, and Shipping Your Games 11. Implementing In-App Purchases Pop Quiz Answers Index

Time for action – displaying the timer and score


Let's set up the help screen and HUD elements that need to be displayed during the game:

  1. Create a new local function called hud():

    local hud = function()
  2. Display helpText at the start of the game for 10 seconds. Have it transition by sliding it to the left and turning visibility to false. Add helpText to the hudGroup group:

      local helpText = display.newImage("help.png")
      helpText.x = 240; helpText.y = 160
      helpText.isVisible = true
      hudGroup:insert( helpText )
    
      timer.performWithDelay( 10000, function() helpText.isVisible = false; end, 1 )
    
      transition.to( helpText, { delay=9000, time=1000, x=-320, transition=easing.inOutExpo })
  3. Display counter and scoreText near the top of the screen. Add scoreText to the hudGroup group as well. Close the function with end:

      counter = display.newText( "Time: " .. tostring(numSeconds), 0, 0, "Helvetica-Bold", counterSize )
      counter:setFillColor( 1, 1, 1 )
      counter.xScale = 0.5; counter.yScale = 0.5
      counter...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}