Specifically, I'm wondering how to place sprites along a 2D geometric shape so that they're equidistant from one another. Sounds fairly easy, right? But then again, I'm a mathlet.
I've used the following code:
for (var i = 0; i < 360; i += 40) // 40 = degrees between each one
However, the objects are not equidistant, nor is the first one located in the top center, as I was hoping for. The spites' origins are mid center.
Also, I want the clock hands to be in the middle of the clock.
The following code achieves this:
These sprites' origins are mid-right, so I've subtracted 16 pixels to account for that.
As you can see in the file below, the code doesn't quite work:
edit: (imagine that the clock hands ARE displayed correctly in this image, because I did get this part of the code working ... the only part that's not working is displaying that same 3x3 sprite of the dude running on the block with the spike character at the correct intervals.
I've used the following code:
for (var i = 0; i < 360; i += 40) // 40 = degrees between each one
Code:
{
draw_sprite_ext(spr_minidiorama_vex,vexflash,display_get_gui_width()/3+display_get_gui_height()/2+cos(i)*600, display_get_gui_height()/2+sin(i)*600,2,2,1,c_white,1)
}
Also, I want the clock hands to be in the middle of the clock.
The following code achieves this:
GML:
draw_sprite_ext(spr_clockhand,0,(display_get_gui_width()/3+display_get_gui_height()/2-16)*cos(270),display_get_gui_height()/2,20,1,clockdegrees,c_white,1)
draw_sprite_ext(spr_clockhand,0,(display_get_gui_width()/3+display_get_gui_height()/2-16)*cos(270),display_get_gui_height()/2,10,1,clockdegreesH,c_white,1)
As you can see in the file below, the code doesn't quite work:
edit: (imagine that the clock hands ARE displayed correctly in this image, because I did get this part of the code working ... the only part that's not working is displaying that same 3x3 sprite of the dude running on the block with the spike character at the correct intervals.
Last edited: