move_bounce_rectangle
/*
** Usage:
** move_bounce_rectangle(x1,y1,x2,y2)
**
** Arguments:
** x1,y1 upper left corner of bounding rectangle
** x2,y2 lower right corner of bounding rectangle
**
** Returns:
** nothing
**
** GMLscripts.com
*/
{
if (bbox_top < argument1) { y = yprevious; vspeed *= -1; }
if (bbox_left < argument0) { x = xprevious; hspeed *= -1; }
if (bbox_right >= argument2) { x = xprevious; hspeed *= -1; }
if (bbox_bottom >= argument3) { y = yprevious; vspeed *= -1; }
}
** Usage:
** move_bounce_rectangle(x1,y1,x2,y2)
**
** Arguments:
** x1,y1 upper left corner of bounding rectangle
** x2,y2 lower right corner of bounding rectangle
**
** Returns:
** nothing
**
** GMLscripts.com
*/
{
if (bbox_top < argument1) { y = yprevious; vspeed *= -1; }
if (bbox_left < argument0) { x = xprevious; hspeed *= -1; }
if (bbox_right >= argument2) { x = xprevious; hspeed *= -1; }
if (bbox_bottom >= argument3) { y = yprevious; vspeed *= -1; }
}
[Please Login]
Projects: 6
Contributor: xot
comments powered by Disqus

Related: