function collisions_startup()
{
wait (3); // wait until the video functions are available
var coords1_x, coords1_y, coords2_x, coords2_y, coords3_x, coords3_y, coords4_x, coords4_y;
var format, pixel1, pixel2, pixel3, pixel4;
COLOR pixel1_color, pixel2_color, pixel3_color, pixel4_color;
while (1)
{
// check player's feet
coords1_x = my_player.pos_x + bmap_width(player_tga); //
coords1_y = my_player.pos_y + bmap_height(player_tga); // play with 2 or - 20
format = bmap_lock (level_tga, 0);
pixel1 = pixel_for_bmap(level_tga, coords1_x, coords1_y);
pixel_to_vec (pixel1_color, NULL, format, pixel1); // store the color of the pixel1 in pixel1_color
if (pixel1_color.red == 255) // detected a red pixel below player's feet?
{
my_player.pos_y -= 2;
}
bmap_unlock (level_tga);
wait (1);
}
}