diff --git a/objects/obj_chunk.object.gmx b/objects/obj_chunk.object.gmx
new file mode 100644
index 0000000..9d7ca99
--- /dev/null
+++ b/objects/obj_chunk.object.gmx
@@ -0,0 +1,23 @@
+
+
diff --git a/objects/obj_controller.object.gmx b/objects/obj_controller.object.gmx
index 286716d..092a883 100644
--- a/objects/obj_controller.object.gmx
+++ b/objects/obj_controller.object.gmx
@@ -74,11 +74,11 @@ step_counter++;
1
/// Draw Debug Screen
-var chunkRelX = obj_player.x % 256
-var chunkRelY = obj_player.y % 256
+var chunkRelX = obj_player.x % (CHUNK_SIZE*TILE_SIZE);
+var chunkRelY = obj_player.y % (CHUNK_SIZE*TILE_SIZE)
-var chunkX = (obj_player.x - chunkRelX) / 256,;
-var chunkY = (obj_player.y - chunkRelY) / 256;
+var chunkX = (obj_player.x - chunkRelX) / (CHUNK_SIZE*TILE_SIZE);
+var chunkY = (obj_player.y - chunkRelY) / (CHUNK_SIZE*TILE_SIZE);
diff --git a/objects/obj_controller_world_gen.object.gmx b/objects/obj_controller_world_gen.object.gmx
index 6c58a52..4e44503 100644
--- a/objects/obj_controller_world_gen.object.gmx
+++ b/objects/obj_controller_world_gen.object.gmx
@@ -50,15 +50,16 @@
1
- var chunkRelX = obj_player.x % 256
-var chunkRelY = obj_player.y % 256
+ var chunkRelX = obj_player.x % (CHUNK_SIZE*TILE_SIZE);
+var chunkRelY = obj_player.y % (CHUNK_SIZE*TILE_SIZE)
-var chunkX = (obj_player.x - chunkRelX) / 256,;
-var chunkY = (obj_player.y - chunkRelY) / 256;
-
-if(loaded_chunks[0] == 0)
- loaded_chunks[0] = load_chunk(chunkX,chunkY);
+var chunkX = (obj_player.x - chunkRelX) / (CHUNK_SIZE*TILE_SIZE);
+var chunkY = (obj_player.y - chunkRelY) / (CHUNK_SIZE*TILE_SIZE) - 1;
+if(!place_meeting(chunkX*(CHUNK_SIZE*TILE_SIZE), chunkY*(CHUNK_SIZE*TILE_SIZE),obj_chunk))
+{
+ instance_create(chunkX*(CHUNK_SIZE*TILE_SIZE),chunkY*(CHUNK_SIZE*TILE_SIZE),obj_chunk);
+}
diff --git a/scripts/load_chunk.gml b/scripts/load_chunk.gml
deleted file mode 100644
index ecd18a8..0000000
--- a/scripts/load_chunk.gml
+++ /dev/null
@@ -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;
-
diff --git a/sprites/images/spr_chunk_0.png b/sprites/images/spr_chunk_0.png
new file mode 100644
index 0000000..8571f28
Binary files /dev/null and b/sprites/images/spr_chunk_0.png differ
diff --git a/sprites/spr_chunk.sprite.gmx b/sprites/spr_chunk.sprite.gmx
new file mode 100644
index 0000000..c44b160
--- /dev/null
+++ b/sprites/spr_chunk.sprite.gmx
@@ -0,0 +1,25 @@
+
+
+ 0
+ 0
+ 0
+ 1
+ 0
+ 0
+ 0
+ 511
+ 0
+ 511
+ 0
+ 0
+ 0
+
+ 0
+
+ 0
+ 512
+ 512
+
+ images\spr_chunk_0.png
+
+