CommitLog |
This commit is contained in:
parent
a9c35b6d6c
commit
10ab496e57
6 changed files with 60 additions and 59 deletions
|
@ -1,48 +0,0 @@
|
|||
///load_chunk(cx,cy);
|
||||
|
||||
var cx = argument0
|
||||
var cy = argument1
|
||||
|
||||
var chunk_grid = ds_grid_create(256,256);
|
||||
var filename = string(cx)+","+string(cy)+".spr";
|
||||
if(file_exists(filename)) // Load Chunk
|
||||
{
|
||||
ini_open(filename);
|
||||
for(var xx = 0; xx < 256; xx++)
|
||||
{
|
||||
for(var yy = 0; yy < 256; yy++)
|
||||
{
|
||||
var nm = string(xx)+string(yy);
|
||||
var c = ini_read_real("XYV",nm,0);
|
||||
chunk_grid[xx,yy] = c;
|
||||
if(c != 0)
|
||||
instance_create(xx,yy,c);
|
||||
}
|
||||
}
|
||||
ini_close();
|
||||
}
|
||||
else // Generate Chunk
|
||||
{
|
||||
ini_open(filename);
|
||||
for(var xx = 0; xx < 256; xx++)
|
||||
{
|
||||
for(var yy = 0; yy < 256; yy++)
|
||||
{
|
||||
var nm = string(xx)+string(yy);
|
||||
if(random_range(0,10) > 5)
|
||||
{
|
||||
ini_write_real("XYV",nm,obj_asteriod);
|
||||
chunk_grid[xx,yy] = obj_asteriod;
|
||||
instance_create(cx+xx,cy+yy,obj_asteriod);
|
||||
}
|
||||
else
|
||||
{
|
||||
ini_write_real("XYV",nm,0);;
|
||||
chunk_grid[xx,yy] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
ini_close();
|
||||
}
|
||||
return chunk_grid;
|
||||
|
Reference in a new issue