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

Border-based collision detection methods

Border-based collision detection involves incrementally searching outward from Actor until either a collision is detected, or it is determined there are no obstacles in the way. The method finds the edge (or border) of the item collided with. This method is especially useful when objects need to bounce off each other or one object is landing on another and needs to remain on that object for a certain amount of time, for example, when a user-controlled Actor is jumping on a platform. We will introduce this method of collision detection in this chapter, as well as use it in upcoming chapters.

Detecting single-object collisions at an offset

The at offset versions of Greenfoot's collision detection methods are well suited to border-based collision detection. They allow us to check for a collision at a certain distance, or offset, from the center of the calling Actor. To demonstrate the use of this method, we will change the implementation of the canMarch...

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