30 lines
795 B
Text
30 lines
795 B
Text
///Generate World Chunks
|
|
|
|
|
|
var xmax = view_xview[0] + view_wview[0];
|
|
var ymax = view_yview[0] - view_hview[0];
|
|
|
|
show_debug_message(xmax);
|
|
show_debug_message(ymax);
|
|
|
|
for(var xx = view_xview[0]; xx < xmax;xx+=32)
|
|
{
|
|
for(var yy = view_yview[0]; yy < ymax;yy+=32)
|
|
{ var expe = string(xx)+string(yy)
|
|
for(var i = 0; i <= obj_controller_world_gen.generated_count; i++)
|
|
{
|
|
if(obj_controller_world_gen.generated_areas[i] == expe)
|
|
{
|
|
return 0;
|
|
}
|
|
}
|
|
obj_controller_world_gen.generated_areas[obj_controller_world_gen.generated_count] = expe;
|
|
obj_controller_world_gen.generated_count ++;
|
|
|
|
if(random_range(0,10) > 5)
|
|
{
|
|
instance_create(xx,yy,obj_asteriod);
|
|
}
|
|
}
|
|
}
|
|
|