Game Development Reference
In-Depth Information
In the preceding code we load the player as well as set its position using the MoveTo
helper that we will define later. In this case we're just adjusting the object so that it is
completely on the screen by accessing the size of the texture and then shifting the
position so it sits in the middle of the texture.
We will define the origin of the texture later on, and this will define the point around
which the texture rotates, as well as the offset for the texture when placed in the
world. Normally the texture would have an origin of 0,0 , which would be at the top-
left corner as shown in the preceding figure; however, we want to place the origin in
the centre so that the texture rotates correctly.
For the enemy we want the following:
Search WWH ::




Custom Search