Learning Java by Building Android Games: Learn Java and Android from scratch by building six exciting games, 2nd Edition

John Horton

商品描述

Get ready for a fun-filled experience of learning Java by developing games for the Android platform

Key Features

  • Learn Java, Android, and object-oriented programming from scratch
  • Build games including Sub Hunter, Retro Pong, Bullet Hell, Classic Snake, and a 2D Scrolling Shooter
  • Create and design your own games, such as an open-world platform game

Book Description

Android is one of the most popular mobile operating systems presently. It uses the most popular programming language, Java, as the primary language for building apps of all types. However, this book is unlike other Android books in that it doesn't assume that you already have Java proficiency.

This new and expanded second edition of Learning Java by Building Android Games shows you how to start building Android games from scratch. The difficulty level will grow steadily as you explore key Java topics, such as variables, loops, methods, object oriented programming, and design patterns, including code and examples that are written for Java 9 and Android P.

At each stage, you will put what you've learned into practice by developing a game. You will build games such as Minesweeper, Retro Pong, Bullet Hell, and Classic Snake and Scrolling Shooter games. In the later chapters, you will create a time-trial, open-world platform game.

By the end of the book, you will not only have grasped Java and Android but will also have developed six cool games for the Android platform.

What you will learn

  • Set up a game development environment in Android Studio
  • Implement screen locking, screen rotation, pixel graphics, and play sound effects
  • Respond to a player's touch, and program intelligent enemies who challenge the player in different ways
  • Learn game development concepts, such as collision detection, animating sprite sheets, simple tracking and following, AI, parallax backgrounds, and particle explosions
  • Animate objects at 60 frames per second (FPS) and manage multiple independent objects using Object-Oriented Programming (OOP)
  • Understand the essentials of game programming, such as design patterns, object-oriented programming, Singleton, strategy, and entity-component patterns
  • Learn how to use the Android API, including Activity lifecycle, detecting version number, SoundPool API, Paint, Canvas, and Bitmap classes
  • Build a side-scrolling shooter and an open world 2D platformer using advanced OOP concepts and programming patterns

Who this book is for

Learning Java by Building Android Games is for you if you are completely new to Java, Android, or game programming and want to make Android games. This book also acts as a refresher for those who already have experience of using Java on Android or any other platform without game development experience.

Table of Contents

  1. Java, Android & Games
  2. Java Basics & An Introduction to Object Oriented Programming - Starting the Sub Hunter Game
  3. Java Variables, Operators, Expressions and Android Debugging - Spawning a Sub to Hunt
  4. Making Decisions with Java If, Else & Switch - Getting the Player's Input
  5. The Android Canvas Class, Drawing to The Screen - Firing Depth Charges
  6. While, Do While, For Loops, Break & Continue - Enhancing Sub Hunter Game
  7. Java Methods - Finishing Sub Hunter Game
  8. Object Oriented Programming - Starting the Pong Game
  9. Interfaces, Threads & Exceptions - Coding the Pong Game Loop
  10. Coding a class for the player's bat & Handling Input
  11. Collisions, Sound FX and Supporting Different Android Versions - Finishing the Pong Game
  12. Handling LOTS of Objects with Arrays - Welcome to Bullet HELL
  13. Drawing with Bitmap Graphics - Coding the Player and Finishing the Game<

商品描述(中文翻譯)

準備好透過開發Android平台遊戲來學習Java的有趣體驗吧!

主要特點:
- 從頭開始學習Java、Android和物件導向程式設計
- 建立包括Sub Hunter、Retro Pong、Bullet Hell、Classic Snake和2D Scrolling Shooter在內的遊戲
- 創建和設計自己的遊戲,例如開放世界平台遊戲

書籍描述:
Android是目前最受歡迎的移動操作系統之一。它使用最流行的程式語言Java作為構建各種應用程式的主要語言。然而,這本書與其他Android書籍不同,它不假設您已經具備Java的熟練程度。

《透過開發Android遊戲學習Java》第二版的全新擴展版將向您展示如何從頭開始建立Android遊戲。隨著您探索Java的關鍵主題,例如變數、迴圈、方法、物件導向程式設計和設計模式,難度將逐漸增加。本書的程式碼和示例是針對Java 9和Android P編寫的。

在每個階段,您將通過開發遊戲將所學知識付諸實踐。您將建立Minesweeper、Retro Pong、Bullet Hell和Classic Snake和Scrolling Shooter等遊戲。在後面的章節中,您將創建一個計時賽、開放世界的平台遊戲。

通過閱讀本書,您不僅將掌握Java和Android,還將為Android平台開發六款酷炫的遊戲。

您將學到:
- 在Android Studio中建立遊戲開發環境
- 實現屏幕鎖定、屏幕旋轉、像素圖形和播放音效
- 回應玩家的觸摸,並編寫以不同方式挑戰玩家的智能敵人
- 學習遊戲開發概念,如碰撞檢測、動畫精靈表、簡單追蹤和跟隨、人工智能、視差背景和粒子爆炸
- 以每秒60幀的速度動畫化物件,並使用物件導向程式設計管理多個獨立物件
- 理解遊戲程式設計的基本要素,如設計模式、物件導向程式設計、單例、策略和實體組件模式
- 學習如何使用Android API,包括Activity生命週期、檢測版本號、SoundPool API、Paint、Canvas和Bitmap類
- 使用高級物件導向程式設計概念和程式設計模式構建側向捲軸射擊遊戲和開放世界2D平台遊戲

本書適合對Java、Android或遊戲程式設計完全陌生的讀者,並希望製作Android遊戲的讀者。對於已經具有在Android或其他平台上使用Java經驗但沒有遊戲開發經驗的讀者,本書也可以作為一個復習資源。

目錄:
1. Java、Android和遊戲
2. Java基礎和物件導向程式設計介紹 - 開始Sub Hunter遊戲
3. Java變數、運算符、表達式和Android除錯 - 生成一艘潛艇來狩獵
4. 使用Java的條件判斷 - 獲取玩家輸入
5. Android Canvas類,繪製到屏幕 - 發射深度炸彈
6. While、Do While、For迴圈、Break和Continue - 增強Sub Hunter遊戲
7. Java方法 - 完成Sub Hunter遊戲
8. 物件導向程式設計 - 開始Pong遊戲
9. 介面、執行緒和異常 - 編寫Pong遊戲迴圈
10. 編寫玩家球拍的類和處理輸入
11. 碰撞、音效和支援不同Android版本 - 完成Pong遊戲
12. 使用陣列處理大量物件 - 歡迎來到Bullet HELL
13. 使用位圖圖形繪製 - 編寫玩家並完成遊戲