GenSetSpriteBounds


GenSetSpriteBounds sprite, left, top, right, bottom, edgemode

sprite

Sprite to be bound.

left

Screen X coordinate of the left edge of the sprite bounds.

top

Screen Y coordinate of the top edge of the sprite bounds.

right

Screen X coordinate of the right edge of the sprite bounds.

bottom

Screen Y coordinate of the bottom edge of the sprite bounds.

edgeMode

The edgeMode determines what happens when a sprite crosses the boundary.

A set of constants are defined in the Game Engine Constants.inc file.

' Boundary Mode
Const Edge_Do_Nothing = 0
Const Edge_Kill_Sprite = 1
Const Edge_Wrap = 2
Const Edge_Rebound = 3
Const Edge_Stop = 4

include "Game Engine Constants.inc"

You may add the above include statement to any Basic program. It is located in the global include directory. The edgeMode constants are declared in this include file.

This command can be used to restrict the movement of an individual sprite. When a sprite crosses the boundary the sprite's boundary event subroutine is triggered.


Game Engine Overview







Become a Patron