Game Development Reference
In-Depth Information
Then, press Done and your event sheet should look like the following screenshot:
You can go ahead and try this out. As you can see, the object will rotate to the mouse
clicks.
Facing the sprite towards the mouse point
A common problem that arises when you make a sprite rotate to the mouse location is that
the graphic seems to be off. This means that the object might be sideways or backwards
and the object isn't facing the mouse correctly. Well, there is a simple reason for this. The
code works perfectly; it's just that the graphic has not been put into Construct 2 correctly.
If you click on the object, you can see where the object will be rotated to.
As you can see in the following screenshot, there is a little line pointing to the right. This
line will always face the mouse.
Search WWH ::




Custom Search