Jump to content


Photo

ContactX(obj) and ContactY(obj)


  • Please log in to reply
1 reply to this topic

#1 BURAK

BURAK

    GMC Member

  • New Member
  • 2 posts
  • Version:GM8

Posted 04 May 2012 - 09:02 PM

Hello friends :)

Posted Image
ContactX(obj)

var a, i, k;
if not place_meeting(x,y,argument0) exit
for(i=0;i<max(sprite_width,sprite_width)/2;i+=1)
{
if collision_circle(x,y,i,argument0,0,0)
{
a=i
break
}
}
for(k=0;k<360;k+=1)
{
if position_meeting(x+lengthdir_x(a,k),y+lengthdir_y(a,k),argument0)
return x+lengthdir_x(a,k)
}

ContactY(obj)

var a, i, k;
if not place_meeting(x,y,argument0) exit
for(i=0;i<max(sprite_width,sprite_width)/2;i+=1)
{
if collision_circle(x,y,i,argument0,0,0)
{
a=i
break
}
}
for(k=0;k<360;k+=1)
{
if position_meeting(x+lengthdir_x(a,k),y+lengthdir_y(a,k),argument0)
return y+lengthdir_y(a,k)
}


http://speedy.sh/jRSvM/ContactX-Y.gmk

Edited by BURAK, 04 May 2012 - 09:44 PM.

  • 0

#2 Rockin

Rockin

    GMC Member

  • New Member
  • 2 posts
  • Version:GM8

Posted 05 May 2012 - 09:05 AM

thanks.
I'm happy to add that into pikselcanavari :)
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users