Flash Game Development by Example by Emanuele Feronato

Flash Game Development by Example by Emanuele Feronato

Author:Emanuele Feronato [Emanuele Feronato]
Language: eng
Format: epub, pdf
Tags: Certification, Game Development, Web Development
Publisher: Packt Publishing
Published: 2011-03-21T22:00:00+00:00


returns true if x property of the_head object is equal or greater than the stage width.

Why does the second if check for x property to be equal or greater while the first one just checked for x property to be smaller (and not to be equal)? That's because x property is 0 when the snake is on the first column so it has to be less than 0 to make you know he left the stage. When the snake is on the rightmost column, x property is 600, so we have to wait for it to be 640 (stage's width) to say the snake is out of the screen. This happens because the head is centered into an imaginary 40x40 pixels rectangle.

The following picture will help you clarify the concept.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.