Jump to content


Photo

[gml] Drawing Spirals With Game Maker


  • Please log in to reply
3 replies to this topic

#1 shm31

shm31

    GMC Member

  • New Member
  • 12 posts

Posted 09 May 2009 - 01:52 PM

Draw Spiral

This script allows to draw spirals,

here's the code :

//draw_spiral(x,y,r,t,p,s,c,a)
var xp,yp,t,r,p,s,c,a;
xp=argument0
yp=argument1
t=(360*argument3)
r=(t/argument2)
p=(360/argument4)
s=argument5
c=argument6
a=argument7
draw_primitive_begin(pr_linestrip){for(v=0; v<t; v+=p)
{draw_vertex_color(xp+(((v/r)*cos(degtorad(v)))*sign(s)),yp+(((v/r)*sin(degtorad(v)))*sign(s)),c,a)}
draw_vertex_color(xp+(((t/r)*cos(degtorad(t)))*sign(s)),yp+(((t/r)*sin(degtorad(t)))*sign(s)),c,a)}
draw_primitive_end()

gm6 :
Posted Image

preview :
Posted Image
  • 0

#2 thundybear

thundybear

    GMC Member

  • New Member
  • 390 posts

Posted 10 May 2009 - 02:36 AM

looks good, but can you tell us what t p and other one-letter-non-descriptive variables are?
  • 0

#3 score_under

score_under

    Least kawaii

  • GMC Member
  • 1319 posts

Posted 10 May 2009 - 10:08 AM

looks good, but can you tell us what t p and other one-letter-non-descriptive variables are?

We'll never need to run the obfuscator on his code :P
  • 0

#4 exar3000

exar3000

    Exarmaster

  • GMC Member
  • 76 posts

Posted 22 May 2009 - 11:01 AM

I believe these are the arguments (I think).

draw_spiral(x,y,r,t,p,s,color,alpha)

t=times/ number of loops
p=precision
s=scale? 1=normal 0=blank -1=flipped
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users