Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Learning Windows 8 Game Development

You're reading from   Learning Windows 8 Game Development Windows 8 brings touchscreens to the tablet and PC. This book will show you how to develop games for both by following clear, hands-on examples. Takes your C++ skills into exciting areas of 3D development.

Arrow left icon
Product type Paperback
Published in Oct 2013
Publisher Packt
ISBN-13 9781849697446
Length 244 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Michael Quandt Michael Quandt
Author Profile Icon Michael Quandt
Michael Quandt
Arrow right icon
View More author details
Toc

Game state and progression


The main thing our game has been lacking so far is an end. The enemies never stop flying at the player and the player never dies because the only penalty for dying is a score penalty. To have a high score, we need an end where we can freeze the score and say the player has earned it. To do this, we need to add in a way to end the game when the player dies. In the next chapter we'll look at implementing a proper menu system, but for now we'll focus on adjusting our game so that it ends and displays a score to the player.

To get started we need to change our game so that it ends at some point. We'll do this by damaging the player when the enemy collides with the player ship. This has the added benefit of giving us a flag that indicates if the player is alive and therefore if the game is running or finished. Thankfully we already have this functionality in the Ship base class that the Player inherits from, so we can go ahead and use that. We also need to decide how...

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 €18.99/month. Cancel anytime