Creative Greenfoot
eBook - ePub

Creative Greenfoot

Michael Haungs

Condividi libro
  1. 310 pagine
  2. English
  3. ePUB (disponibile sull'app)
  4. Disponibile su iOS e Android
eBook - ePub

Creative Greenfoot

Michael Haungs

Dettagli del libro
Anteprima del libro
Indice dei contenuti
Citazioni

Informazioni sul libro

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.

Domande frequenti

Come faccio ad annullare l'abbonamento?
È semplicissimo: basta accedere alla sezione Account nelle Impostazioni e cliccare su "Annulla abbonamento". Dopo la cancellazione, l'abbonamento rimarrà attivo per il periodo rimanente già pagato. Per maggiori informazioni, clicca qui
È possibile scaricare libri? Se sì, come?
Al momento è possibile scaricare tramite l'app tutti i nostri libri ePub mobile-friendly. Anche la maggior parte dei nostri PDF è scaricabile e stiamo lavorando per rendere disponibile quanto prima il download di tutti gli altri file. Per maggiori informazioni, clicca qui
Che differenza c'è tra i piani?
Entrambi i piani ti danno accesso illimitato alla libreria e a tutte le funzionalità di Perlego. Le uniche differenze sono il prezzo e il periodo di abbonamento: con il piano annuale risparmierai circa il 30% rispetto a 12 rate con quello mensile.
Cos'è Perlego?
Perlego è un servizio di abbonamento a testi accademici, che ti permette di accedere a un'intera libreria online a un prezzo inferiore rispetto a quello che pagheresti per acquistare un singolo libro al mese. Con oltre 1 milione di testi suddivisi in più di 1.000 categorie, troverai sicuramente ciò che fa per te! Per maggiori informazioni, clicca qui.
Perlego supporta la sintesi vocale?
Cerca l'icona Sintesi vocale nel prossimo libro che leggerai per verificare se è possibile riprodurre l'audio. Questo strumento permette di leggere il testo a voce alta, evidenziandolo man mano che la lettura procede. Puoi aumentare o diminuire la velocità della sintesi vocale, oppure sospendere la riproduzione. Per maggiori informazioni, clicca qui.
Creative Greenfoot è disponibile online in formato PDF/ePub?
Sì, puoi accedere a Creative Greenfoot di Michael Haungs in formato PDF e/o ePub, così come ad altri libri molto apprezzati nelle sezioni relative a Informatique e Programmation en Java. Scopri oltre 1 milione di libri disponibili nel nostro catalogo.

Informazioni

Anno
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...

Indice dei contenuti