Jump to content


Photo

Snapping An Object To Another Object


  • Please log in to reply
3 replies to this topic

#1 dr. light

dr. light

    GMC Member

  • New Member
  • 76 posts

Posted 09 August 2009 - 04:13 AM

For the purposes of physics, I need a character's feet to be a separate object from the character. I have in the step event of obj_player_feet to go to obj_player.x and obj_payer.y. In game, though, the feet lag behind a few pixels. I usually fix this problem in my other games by putting a sprite draw in the draw event, but I can't now since the sprite changes.

Is there any way to either:
Snap an object to another more precisely, or
allow sprite changes to effect the draw event.

Edited by dr. light, 09 August 2009 - 04:15 AM.

  • 0

#2 Locate

Locate

    TeamCyborg

  • New Member
  • 337 posts

Posted 09 August 2009 - 04:19 AM

draw_sprite(sprite_index,image_index,x,y);

Don't change the arguments inside.

Edited by Locate, 09 August 2009 - 04:21 AM.

  • 0

#3 dr. light

dr. light

    GMC Member

  • New Member
  • 76 posts

Posted 09 August 2009 - 04:23 AM

draw_sprite(sprite_index,image_index,x,y);

Don't change the arguments inside.


>_<
So simple, I can't believe I didn't think of that.
  • 0

#4 Locate

Locate

    TeamCyborg

  • New Member
  • 337 posts

Posted 09 August 2009 - 04:34 AM

If you are using Pro, I'd recommend using,
draw_sprite_ext(sprite_index,image_index,x,y,xscale,yscale,ima
ge_angle,c_white,image_alpha)

Edit: Keep it all on one line though, for some reason it keeps splitting the text on here.

Edited by Locate, 09 August 2009 - 04:39 AM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users