jmejay, if you set the argument to move_bounce() to true, it will reflect correctly. Meaning, use move_bounce_all(true) instead of false. That should suit your needs, unless I've missed something specific about this case.
-IMP
Thanks.
Male
jmejay hasn't added any friends yet.
21 August 2011 - 04:59 AM
jmejay, if you set the argument to move_bounce() to true, it will reflect correctly. Meaning, use move_bounce_all(true) instead of false. That should suit your needs, unless I've missed something specific about this case.
-IMP
21 August 2011 - 01:15 AM
As for your argument error, you "skipped" using argument5. You accessed 0123467 when it should have been 0123456.
20 August 2011 - 11:03 PM
w = sprite_get_width(0); h = sprite_get_height(0);
bSpd = 4;
if(mouse_check_button_pressed(mb_left) || keyboard_check_pressed(vk_space)){connected = false;}
if(connected == true){x = objBat.x; y = objBat.y-16;}
else
{
speed = bSpd;
hitcube = collision_point(x,y,cube,false,true);
if(hitcube > 1)
{
direction = Bounce(direction, x, y, hitcube.x, hitcube.y, w, h);
hitcube = instance_destroy(); // or remove hp
score += 1;
}
hitbat = collision_point(x,y,objBat,false,true);
if(hitbat > 1)
{
direction = Bounce(direction, x, y, hitbat.x, hitbat.y, w, h);
}
}
dir = argument0; //direction
xx = argument1; //ball x
yy = argument2; //ball y
othx = argument3;// other obj x
othy = argument4;// other obj y
w = argument6;// ball w
h = argument7;// ball h
hw = w / 2;
hh = h / 2;
// other objs width is assumed to be 16 hence othx + 8
if(xx + hw < othx - 8) // if hits left side
{
retdir = 90 - dir; retdir *= 2;
dir += retdir;
return dir;
}
if(xx - hw > othx + 8) // if hits right side
{
retdir = 90 - dir; retdir *= 2;
dir += retdir;
return dir;
}
if(yy - hh > othy + 8)// if hits from below
{
retdir = 90 - dir; retdir += 270;
dir = retdir;
return dir;
}
if(yy + hh < othy - 8)// if hits from above
{
retdir = 90 - dir; retdir += 270;
dir = retdir;
return dir;
}
20 August 2011 - 08:53 PM
20 August 2011 - 12:03 PM
Community Forum Software by IP.Board
Licensed to: YoYo Games Ltd

Find content