30 likes | 244 Views
Coordinates in Game Design. Absolute and Relative Location. Scratch. Scratch's coordinate system uses 2 coordinates, "X position" and "Y position", to determine the location of a Sprite on the stage.
E N D
Coordinates in Game Design Absolute and Relative Location
Scratch • Scratch's coordinate system uses 2 coordinates, "X position" and "Y position", to determine the location of a Sprite on the stage. • The "X position" value determines the horizontal location of the sprite and the "Y position" value determines the vertical location or height. • The screen is a 480x360 rectangle, such that: the X position can range from 240 to -240, where 240 is the rightmost a sprite can be and -240 is the leftmost, and the Y position can range from 180 to -180, where 180 is the highest it can be and -180 is the lowest it can be. • In this system, (0, 0) is considered the center of the screen • The X position and Y position of a sprite can be determined and set by the following blocks:
Direction in Scratch • Direction is determined by a rotational number system. The direction 0 is straight up. Every 90 units is equivalent to a quarter turn, where +90 is 90 degrees clockwise and -90 is 90 degrees counter-clockwise. • The direction never exceeds 180 or goes below -180; it is always (internally) kept within these limits with the function: