Creative Greenfoot
eBook - ePub

Creative Greenfoot

Michael Haungs

Buch teilen
  1. 310 Seiten
  2. English
  3. ePUB (handyfreundlich)
  4. Über iOS und Android verfügbar
eBook - ePub

Creative Greenfoot

Michael Haungs

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

About This Book

  • Apply a wide variety of game design and programming animation techniques to create immersive interactive applications that use state-of-the-art controllers and input devices
  • Quickly learn key concepts in animation, physics, and artificial intelligence to jump-start your journey into creative computing
  • Gain a deep understanding of interactive development by working systematically from concept to design with several engaging example applications

Who This Book Is For

This book is for coding students and Java programmers of all levels interested in building engaging, interactive applications with Greenfoot. Familiarity with the very basics of Greenfoot is assumed.

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Creative Greenfoot als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Creative Greenfoot von Michael Haungs im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatique & Programmation en Java. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

Jahr
2015
ISBN
9781783980390

Creative Greenfoot


Table of Contents

Creative Greenfoot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
Questions
1. Let's Dive Right in…
The Avoider Game tutorial
Basic game elements
Creating a scenario
Creating our world
Creating our hero
What have we just done?
Adding our hero
Using the mouse as a game controller
Creating the followMouse function
Breaking down the code
Adding enemies
Enemy code
Creating an army
Unbounding the world
Memory management
Your assignment
Next…
Making it a game
Detecting collisions
Adding a game-over screen
Switching scenes
Adding a "play again" button
Adding an introduction screen
Setting the initial screen
Adding a "play" button
Adding background music
Writing the music code
Analyzing the music code
Stop the music
Your assignment
Next…
Enhancing playability
Game scoring
Adding the Counter class
Increasing the score over time
Adding levels
Increasing spawn rates and enemy speed
Increasing difficulty based on the score
Implementing enemy speed increases
Your assignment
Next…
Summary
2. Animation
Revisiting Avoider Game
Image swapping and movement
Using setImage()
Making enemies less happy
Finding assets
Calling setImage() based on Actor location
Using setLocation()
Creating a star field
A blank slate
The Star class
Creating a moving field
Using parallax
Using GreenfootImage
Timing and synchronization
Delay variables
Hurting the avatar
Random actions
Blinking
Triggered events
Adding eyes
Giving our hero sight
Easing
Power-ups and power-downs
Base class
Linear easing
Exponential easing
Sinusoidal easing
Changes to the Avatar class
Changes to the AvoiderWorld class
Avoider Game
Your assignment
Summary
3. Collision Detection
ZombieInvasion interactive simulation
Dynamically creating actors in ZombieInvasionWorld
Creating obstacles
Creating our main actor framework
Creating an explosion
Test it out
Built-in collision detection methods
Detecting a collision with a single object
isTouching() and removeTouching()
Detecting a collision with multiple objects
Detecting multiple objects in range
Time to test it out
Border-based collision detection methods
Detecting single-object collisions at an offset
Detecting multiple-object collisions at an offset
Hidden-sprite collision detection methods
Challenge
Summary
4. Projectiles
Cupcake Counter
How to play
Implementing Cupcake Counter
The CupcakeWorld class
Enemies
Fountains
Turrets
Rewards
Jumpers
Platforms
Test it out
Your assignment
Launching actors
Gravity and jumping
Bouncing
Particle effects
Bullets and turrets
Your assignment
Challenge
Summary
5. Interactive Application Design and Theory
Meaningful play
Complexity
Goals
User conditioning
Storytelling
Fictional worlds
Narrative descriptors
The interactive entertainment iterative development process
Game pitch and initial design
Prototype
Playtest
Evaluation
Refinement
Benefits
Avoider Game
Avoider Game recap
High-score list
Achievement badges
Player conditioning
Storytelling
Adding a story screen
Changing the score
Adding sound effects
Playtesting
Challenge
Additional readings
Summary
6. Scrolling and Mapped Worlds
Chapter scenario examples
Dynamically generated worlds
Side-scrolling
The Rocket class
The CloudsWorld class
Side-scrolling actors
Clouds
Walls
Try it out
Mapped worlds
Side-scrolling
The HikingWorld class
The Hiker class
The ScrollingActor class
Try it out
2D scrolling
The HikingWorld2D class
The Hiker class
The ScrollingActor class
Try it out
Tile-based worlds
Actors as tiles
The HikingWorld class
The Hiker class
The ScrollingActor class
Tiles
The Lake class
Try it out
Other game sprites
Summary
7. Artificial Intelligence
The MazeWorld scenario
The MazeWorld class
The Hiker class
Scrolling actor
The ScrollingObstacle class
Intelligently behaving actors
The ScrollingEnemy class
Randomness
Spider
Behavior heuristics
The Snake class
A* pathfinding
Overview
Algorithm
The Mouse class
Play test
Summary
8. User Interfaces
UIWorld
The Button class
The TextBox class
The Menu class
Heads-up display
Adding a UI to MazeWorld
Adding menus and buttons
Adding a HUD
Implementing game difficulty settings and HUD controls
Summary
9. Gamepads in Greenfoot
Gamepad overview
Windows setup
Connecting your controller
Greenfoot gamepad software
The Greenfoot Gamepad API
Overview
The GamePad and Direction classes
Avoider Game with Gamepad
Try it out
OS X setup/workarounds
Gamepad mapper software
Exporting games with gamepads
Summary
10. What to Dive into Next…
Build something larger
Share your work
Publishing on Greenfoot.org
Desktop application
Exporting as a web page
Explore other input devices
Learn more Java
Summary
Index

Creative Greenfoot

Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: April 2015
Production reference: 1230415
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78398-038-3
www.packtpub.com

Credits

Author
Michael Haungs
Reviewers
Thomas Cooper
Keenan Gebze
Foaad Khosmood
Kevin Rowan
Commissioning Editor
Sam Wood
Acquisition Editor
Sam Wood
Content Development Editor
Ar...

Inhaltsverzeichnis