Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Paint with Pixels by oliver @pixelchipcode
- // obj_paint_spawner Step Event
- if (mouse_check_button(mb_left)) {
- repeat(20) {
- var angle = random(360);
- var radius = random(10);
- var rx = mouse_x + lengthdir_x(radius, angle);
- var ry = mouse_y + lengthdir_y(radius, angle);
- instance_create_layer(rx, ry, "Instances", obj_paint);
- }
- }
- // obj_paint Create Event
- y_speed = random(1);
- friction = random_range(0.8, 0.99);
- // obj_paint Step Event
- y_speed *= friction;
- y += y_speed;
- if (y_speed <= 0.01) instance_destroy();
- if (surface_exists(obj_surface_paint.canvas_surface)) {
- surface_set_target(obj_surface_paint.canvas_surface);
- draw_self();
- surface_reset_target();
- }
- // obj_surface_paint Create Event
- canvas_surface = surface_create(256, 256);
- // obj_surface_paint Draw Event
- if (!surface_exists(canvas_surface)) canvas_surface = surface_create(256, 256);
- draw_surface(canvas_surface, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment