Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Creative Greenfoot: RAW
  • Table Of Contents Toc
  • Feedback & Rating feedback
Creative Greenfoot: RAW

Creative Greenfoot: RAW

By : Haungs
4.7 (3)
close
close
Creative Greenfoot: RAW

Creative Greenfoot: RAW

4.7 (3)
By: Haungs

Overview of this book

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.
Table of Contents (12 chapters)
close
close
11
Index

Built-in collision detection methods

We are going to go through all the methods provided by Greenfoot to do collision detection. First, we will go over some methods and discuss their intended use. Then, we'll discuss the remaining methods in the context of more advanced collision detection methods (border-based and hidden-sprite). We have already used a few collision detection methods in the implementation of Avoider Game. We will only briefly describe those particular methods here. Finally, we will not discuss getNeighbors() and intersects(), as those methods are only useful for Greenfoot scenarios that contain worlds that are created with a cell size greater than one.

Note

Cell size and Greenfoot worlds

Until now, we have only created worlds (AvoiderWorld and ZombieInvasionWorld) that have set the cellSize parameter of the World constructor to 1. The following is an excerpt from Greenfoot's documentation on the World class:

public World(int worldWidth, int worldHeight, int cellSize...
Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Creative Greenfoot: RAW
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon