The definition takes the form of a function definition:
The special word "this" means "whatever this happens to be". We don't know whether it's going to be a bug, a melon, or a toaster. And it doesn't matter -- they're all going to be treated the same.
The trick is that we don't use MySprite directly. Instead, we make other things that are MySprites.
Now, you can refer to things like bug1.x, bug1.y, bug2.x, etc.
|