Java programming with Greenfoot: lettuce is good for you (collision detection)

5
0
4
0
3
0
2
0
1
0
0
Rate this resource

In this video tutorial the concept of collision detection is introduced.  This is a key aspect of many games – recognising that two objects are touching.  This is explained with the creation of a lettuce class within the game.  When the turtle touches a lettuce it appears to eat it and so it disappears.  This is modelled via the use of an if statement.  This tutorial also introduces the save world function so that a student can save their programme in its current state and run it from their rather than returning to the beginning.

More resources can be found here

Show health and safety information

Please be aware that resources have been published on the website in the form that they were originally supplied. This means that procedures reflect general practice and standards applicable at the time resources were produced and cannot be assumed to be acceptable today. Website users are fully responsible for ensuring that any activity, including practical work, which they carry out is in accordance with current regulations related to health and safety and that an appropriate risk assessment has been carried out.

Published by

Actions

Share this resource