Game Development Reference
In-Depth Information
64 on the y axis; this will put the text in the top left of the screen but, will not overlap the
wall objects.
Then, we enter the string we want to draw. This requires some explanation. All strings
must be enclosed with quotation marks. This is why we have Score: in quotes in the
text. We need to put a space after the colon so the score's value is spaced out by one.
Anything inside of the quotes will be drawn to the screen including spaces. Next, we are
using the string function to convert our score variable to a string and add it to the
manually entered string. Eventually, we end up drawing in the following format:
Score: <value>
If we run the game now, we should see the score being drawn to the top left of the screen
and the value should rise every time we collect an object.
Search WWH ::




Custom Search