Learning Java by Building Android Games: Learn Java and Android from scratch by building six exciting games, 2nd Edition
暫譯: 從零開始學習 Java:透過建構六款刺激的遊戲學習 Java 和 Android,第二版

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 滾動射擊遊戲在內的遊戲

  • 創建和設計自己的遊戲,例如開放世界平台遊戲

書籍描述

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

這本《透過建立 Android 遊戲學習 Java》的新擴充第二版將向你展示如何從零開始構建 Android 遊戲。隨著你探索 Java 的關鍵主題,如變數、迴圈、方法、物件導向程式設計和設計模式,難度將穩步增加,並包括為 Java 9 和 Android P 編寫的代碼和範例。

在每個階段,你將通過開發遊戲來實踐所學的知識。你將建立如 Minesweeper、Retro Pong、Bullet Hell 和 Classic Snake 及滾動射擊遊戲。在後面的章節中,你將創建一個計時賽的開放世界平台遊戲。

到書籍結束時,你不僅會掌握 Java 和 Android,還會為 Android 平台開發六款酷炫的遊戲。

你將學到什麼


  • 在 Android Studio 中設置遊戲開發環境

  • 實現螢幕鎖定、螢幕旋轉、像素圖形和播放音效

  • 響應玩家的觸控,並編程智能敵人以不同方式挑戰玩家

  • 學習遊戲開發概念,如碰撞檢測、動畫精靈圖、簡單的追蹤和跟隨、人工智慧、視差背景和粒子爆炸

  • 以每秒 60 幀 (FPS) 動畫物件,並使用物件導向程式設計 (OOP) 管理多個獨立物件

  • 理解遊戲程式設計的基本要素,如設計模式、物件導向程式設計、單例模式、策略模式和實體-組件模式

  • 學習如何使用 Android API,包括 Activity 生命週期、檢測版本號、SoundPool API、Paint、Canvas 和 Bitmap 類別

  • 使用進階 OOP 概念和程式設計模式建立側滾射擊遊戲和開放世界 2D 平台遊戲

本書適合誰

如果你對 Java、Android 或遊戲程式設計完全陌生,並想製作 Android 遊戲,那麼《透過建立 Android 遊戲學習 Java》就是為你而寫的。本書也適合那些已經有在 Android 或其他平台上使用 Java 的經驗,但沒有遊戲開發經驗的人作為複習。

目錄


  1. Java、Android 與遊戲

  2. Java 基礎與物件導向程式設計簡介 - 開始 Sub Hunter 遊戲

  3. Java 變數、運算子、表達式與 Android 除錯 - 生成一艘潛艇來狩獵

  4. 使用 Java 的 If、Else 和 Switch 進行決策 - 獲取玩家的輸入

  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. 使用 Bitmap 圖形繪製 - 編碼玩家並完成遊戲