F
////////////////////////////////////
//Initialize surface
global.scv = surface_create(room_width,room_height);
if !surface_exists(global.scv)
{
global.scv = surface_create(room_width, room_height);
surface_set_target(global.scv);
draw_clear_alpha(c_black, 0);
surface_reset_target();
view_surface_id[0] = global.scv;
}
////////////////////////////////////
//Call this to create the spiral on the surface
a = 1;
b = 1;
surface_set_target(global.scv);
for (i=0; i< 720; i++) {
//The angle constant here sets the 'resolution', or dot spacing. Big spirals could show dot separation if the number is too big.
angle = 0.03 * i;
xd=(1+angle)*cos(angle);
yd=(1+angle)*sin(angle);
draw_point(xd+(room_width/2),yd+(room_height/2));
}
surface_reset_target();
//////////////////////////////
//Call this to draw
if (surface_exists(global.scv))
{
draw_surface(global.scv,0,0);
}
Which event would this go in? I put it in draw but it didn't do anythingOne way to achieve the spiral would be using surfaces and draw_point. The surface will mean you only have to draw pixels once. You don't want it looping in the draw event.
To guide draw_pixel to draw the spiral, clever use of sine and cosine could probably get a circle motion. Then the radius would have to be reduced as it turns. This is how I would start with this as a concept.
Code://////////////////////////////////// //Initialize surface global.scv = surface_create(room_width,room_height); if !surface_exists(global.scv) { global.scv = surface_create(room_width, room_height); surface_set_target(global.scv); draw_clear_alpha(c_black, 0); surface_reset_target(); view_surface_id[0] = global.scv; } //////////////////////////////////// //Call this to create the spiral on the surface a = 1; b = 1; surface_set_target(global.scv); for (i=0; i< 720; i++) { //The angle constant here sets the 'resolution', or dot spacing. Big spirals could show dot separation if the number is too big. angle = 0.03 * i; xd=(1+angle)*cos(angle); yd=(1+angle)*sin(angle); draw_point(xd+(room_width/2),yd+(room_height/2)); } surface_reset_target(); ////////////////////////////// //Call this to draw if (surface_exists(global.scv)) { draw_surface(global.scv,0,0); }