diff --git a/Spaceinator.project.gmx b/Spaceinator.project.gmx index 906fdba..6d6be44 100644 --- a/Spaceinator.project.gmx +++ b/Spaceinator.project.gmx @@ -16,6 +16,7 @@ sprites\spr_enemy sprites\spr_asteroid sprites\spr_boom + sprites\spr_empty background\bg_space @@ -30,6 +31,7 @@ objects\obj_controller objects\obj_bullet objects\obj_asteriod + objects\obj_air rooms\rm_game diff --git a/objects/obj_air.object.gmx b/objects/obj_air.object.gmx new file mode 100644 index 0000000..2c4e293 --- /dev/null +++ b/objects/obj_air.object.gmx @@ -0,0 +1,23 @@ + + + spr_empty + 0 + -1 + 0 + 0 + <undefined> + <undefined> + + 0 + 0 + 0 + 0.5 + 0.100000001490116 + 0 + 0.100000001490116 + 0.100000001490116 + 0.200000002980232 + -1 + 0 + + diff --git a/objects/obj_asteriod.object.gmx b/objects/obj_asteriod.object.gmx index f7a1875..b10635e 100644 --- a/objects/obj_asteriod.object.gmx +++ b/objects/obj_asteriod.object.gmx @@ -27,12 +27,10 @@ 1 image_speed = 0; image_index = random_range(0,1); -var angle = random_range(0,180); +angle = random_range(0,180); direction = angle; image_angle = angle; -speed = 1; - diff --git a/objects/obj_controller_world_gen.object.gmx b/objects/obj_controller_world_gen.object.gmx index d9c4f90..f81b847 100644 --- a/objects/obj_controller_world_gen.object.gmx +++ b/objects/obj_controller_world_gen.object.gmx @@ -25,11 +25,7 @@ 1 - generated_count = 0; -generated_areas[10000] = 0; - - - + diff --git a/scripts/generate_world.gml b/scripts/generate_world.gml index a319a0c..8496fef 100644 --- a/scripts/generate_world.gml +++ b/scripts/generate_world.gml @@ -13,32 +13,21 @@ startx = startx - (startx % 32); starty = starty - (starty % 32); -for(var xx = startx; xx < xmax;xx+=32) +for(var xx = startx; xx < xmax; xx+=32) { for(var yy = starty; yy < ymax;yy+=32) { - var expe = string(xx)+string(yy) - var should_continue = false; - for(var i = 0; i <= generated_count; i++) - { - if(obj_controller_world_gen.generated_areas[i] == expe) + + + if(!place_free(xx,yy)) + { + instance_create(xx,yy,obj_air); + + if(random_range(0,10) > 5) { - should_continue = true; - break; + instance_create(xx,yy,obj_asteriod); } } - if(should_continue) - { - continue; - } - - generated_areas[generated_count] = expe; - generated_count ++; - - if(random_range(0,10) > 5) - { - instance_create(xx,yy,obj_asteriod); - } } } diff --git a/sprites/images/spr_empty_0.png b/sprites/images/spr_empty_0.png new file mode 100644 index 0000000..6e3cb09 Binary files /dev/null and b/sprites/images/spr_empty_0.png differ diff --git a/sprites/spr_empty.sprite.gmx b/sprites/spr_empty.sprite.gmx new file mode 100644 index 0000000..09d34af --- /dev/null +++ b/sprites/spr_empty.sprite.gmx @@ -0,0 +1,25 @@ + + + 0 + 0 + 0 + 0 + 0 + -1 + 1 + 0 + 31 + 0 + 31 + 0 + 0 + + 0 + + 0 + 32 + 32 + + images\spr_empty_0.png + +