• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Need an object to move around a circle.

B

Blank

Guest
Hi guys, I need help with a very simple problem that i cant fix via Google. I have my player who is a circle I call Bob because of... whatever.. and he needs a sword which I cant seem to provide as his creator.
Its top down and the sword is drawn towards the top right and both the player and the sword object is 64x64. The player is facing towards the mouse 360 degrees direction via
Code:
image_angle = point_direction(x, y, mouse_x, mouse_y);
I need the sword placed properly but I also need the sword to move around the player while also rotating depnding what direction its facing in. I tried setting the coords of the bottom of the sword in sync with whatever coords i used on the player object but i found that changing the angle of the sprite doesnt change the coords that other objects (in this case a sword) are in sync with. Also where do i center the sword's sprite?
Thanks
-Blank
 
It's a shame Google drew a 'blank' for you on this one.
Do some searches in the Gamemaker manual, and/or Google for lengthdir_x and lengthdir_y.
Also, look up how to set "sprite origin".
 
Last edited:
B

Blank

Guest
Ah okay the sprite origin fixed my issue, thanks. And ha ha a blank so funny xD.
thanks a mil
 
Top