Creative Greenfoot
eBook - ePub

Creative Greenfoot

Michael Haungs

Partager le livre
  1. 310 pages
  2. English
  3. ePUB (adapté aux mobiles)
  4. Disponible sur iOS et Android
eBook - ePub

Creative Greenfoot

Michael Haungs

DĂ©tails du livre
Aperçu du livre
Table des matiĂšres
Citations

À propos de ce livre

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.

Foire aux questions

Comment puis-je résilier mon abonnement ?
Il vous suffit de vous rendre dans la section compte dans paramĂštres et de cliquer sur « RĂ©silier l’abonnement ». C’est aussi simple que cela ! Une fois que vous aurez rĂ©siliĂ© votre abonnement, il restera actif pour le reste de la pĂ©riode pour laquelle vous avez payĂ©. DĂ©couvrez-en plus ici.
Puis-je / comment puis-je télécharger des livres ?
Pour le moment, tous nos livres en format ePub adaptĂ©s aux mobiles peuvent ĂȘtre tĂ©lĂ©chargĂ©s via l’application. La plupart de nos PDF sont Ă©galement disponibles en tĂ©lĂ©chargement et les autres seront tĂ©lĂ©chargeables trĂšs prochainement. DĂ©couvrez-en plus ici.
Quelle est la différence entre les formules tarifaires ?
Les deux abonnements vous donnent un accĂšs complet Ă  la bibliothĂšque et Ă  toutes les fonctionnalitĂ©s de Perlego. Les seules diffĂ©rences sont les tarifs ainsi que la pĂ©riode d’abonnement : avec l’abonnement annuel, vous Ă©conomiserez environ 30 % par rapport Ă  12 mois d’abonnement mensuel.
Qu’est-ce que Perlego ?
Nous sommes un service d’abonnement Ă  des ouvrages universitaires en ligne, oĂč vous pouvez accĂ©der Ă  toute une bibliothĂšque pour un prix infĂ©rieur Ă  celui d’un seul livre par mois. Avec plus d’un million de livres sur plus de 1 000 sujets, nous avons ce qu’il vous faut ! DĂ©couvrez-en plus ici.
Prenez-vous en charge la synthÚse vocale ?
Recherchez le symbole Écouter sur votre prochain livre pour voir si vous pouvez l’écouter. L’outil Écouter lit le texte Ă  haute voix pour vous, en surlignant le passage qui est en cours de lecture. Vous pouvez le mettre sur pause, l’accĂ©lĂ©rer ou le ralentir. DĂ©couvrez-en plus ici.
Est-ce que Creative Greenfoot est un PDF/ePUB en ligne ?
Oui, vous pouvez accĂ©der Ă  Creative Greenfoot par Michael Haungs en format PDF et/ou ePUB ainsi qu’à d’autres livres populaires dans Informatique et Programmation en Java. Nous disposons de plus d’un million d’ouvrages Ă  dĂ©couvrir dans notre catalogue.

Informations

Année
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...

Table des matiĂšres