For handling moving objects ("sprites"), App Inventor uses an X/Y coordinate system for position on the screen, Heading for direction of movement, and Speed and Interval for velocity.
X and Y measure horizontal and vertical distance from the top left of the screen in units of pixels. By default, the Screen1 Sizing parameter is set to
Fixed, which generates apps with a horizontal dimension of 320 pixels in portrait orientation. The vertical dimension varies with the device; designing for 320x480 pixels should work on most devices. Changing the Sizing parameter to
Responsive results in apps that use the full screen resolution, which varies considerably from one device to another. The apps in this course use Fixed sizing for predictable behaviour.
The
Z value of a sprite determines the stacking order when sprites overlap, with higher numbered sprites rendered in front of lower numbered sprites.
Heading is expressed as an angle between 0 and 359 degrees, with 0 representing movement to the right, and proceeding anti-clockwise from there.
Interval determines the time in milliseconds between updates to a sprite's position, while
Speed determines how many pixels the sprite moves per update. Setting the Speed to 5 and the Interval to 10 (i.e. 5 pixels every 10 ms) is a reasonable starting point for a rolling ball with smooth animation.
There are built-in procedures to detect when a sprite reaches the edge of the screen, with the value of
Edge set to 1, 3, -1, -3 for top, right, bottom, left respectively. Edge values are also used for the corners, where 2, 4, -2, -4 represent top right, bottom right, bottom left, top left respectively.
This document contains a reference diagram showing the X/Y, Heading and Edge schemes, and would be useful to have to hand when working on arcade style games:
App Inventor Coordinate System