(CGA) Object Properties Lesson
Object Properties
Objects have things they know about themselves called properties. The properties of an object are also known as attributes. In games, the object's attributes will change during the program execution. The bird may move to a different location, it may change images, speed, or direction.
Variables
he properties of an object are stored in variables. They are called instance variables because they belong to the object. When an object is created, it is called an instance of the class.
In addition to instance variables, there are other types of variables used in programs. Access the learning object below to learn more about the different types of variables and how to use them in your program.
Working with Images
GreenfootImage is the class in the Greenfoot API that supports using and manipulating images. To use an image, it must exist in the scenario's image folder.
The Greenfoot image library has readymade images to use in your scenario. Greenfoot can read images in JPEG, PNG, GIF, BMP, and TIFF formats.
Access the learning object below to learn how to use images in your program.
[CC BY 4.0] UNLESS OTHERWISE NOTED | IMAGES: LICENSED AND USED ACCORDING TO TERMS OF SUBSCRIPTION