Game Development Reference
My name is Rex. However, I'm not the only Rex in the world. There's another Rex: my friend's dog,
which lives in a very pretty little village just outside of Bangalore, India. So there are two Rex's:
How can you tell the difference? Well, one of them wags his tail and barks. I'll leave it up to you to
guess which one. But, apart from that, you know that they live in different places . I live in Canada, so
my proper object name might be this:
My friend's dog lives in India, so his proper object name might be this:
This is another basic feature of dot notation. In front of the most basic bit of information, the object's
name, you need to indicate where the object lives. You can add as much or as little information about
where the objects live as you need to. Because both India and Canada are on the Earth, you could go
one step further:
The objects are still the same, even though they're described a little more clearly.
You can use this general model for naming objects with dot notation:
Once you know the name of the object, you can add or modify properties to change it in some way,
or you can invoke methods to allow it to run certain directives.