Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //paste that in main.c
- int spiralx, spiraly;
- float spiralv;
- double degtorad(double angle)
- {
- return angle * 3.14 / 180;
- }
- void drawspiral(maxspiral,spart)
- {
- int i = 0;
- for(i = 0; i < maxspiral; i++)
- {
- if(spiralv!=360)
- {
- spiralv+=0.1;
- }
- else if(spiralv==360)
- {
- spiralv = 1;
- }
- spiralx = mousex+spiralv*cos(degtorad(spiralv));
- spiraly = mousey+spiralv*sin(degtorad(spiralv));
- create_part(-1,spiralx,spiraly,spart);
- }
- }
- // that too in main.c, but next to sdl_key checkings
- if(sdl_key=='e')
- {
- drawspiral(360,sl);
- }
- if(sdl_key=='r')
- {
- spiralv = 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement