diff --git a/objects/obj_asteriod.object.gmx b/objects/obj_asteriod.object.gmx index 179a607..247a2f9 100644 --- a/objects/obj_asteriod.object.gmx +++ b/objects/obj_asteriod.object.gmx @@ -54,7 +54,10 @@ image_angle = angle; 1 - instance_create(x,y,obj_dropped_stone); + with(instance_create(x,y,obj_dropped_item)) +{ + item_id = STONE; +} @@ -85,6 +88,29 @@ if(speed > 0) pull_towards_black_holes(); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + speed = -20; diff --git a/objects/obj_bullet.object.gmx b/objects/obj_bullet.object.gmx index cf90b02..9c9f3ae 100644 --- a/objects/obj_bullet.object.gmx +++ b/objects/obj_bullet.object.gmx @@ -57,6 +57,31 @@ if(step_counter == 60*room_speed || instance_position(x,y,obj_chunk) == noone) { instance_destroy(self); } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + instance_destroy(other); +instance_create(other.x,other.y,obj_boom_fx) +instance_destroy(id); diff --git a/objects/obj_chunk.object.gmx b/objects/obj_chunk.object.gmx index 1ab8d4a..573192f 100644 --- a/objects/obj_chunk.object.gmx +++ b/objects/obj_chunk.object.gmx @@ -2,7 +2,7 @@ spr_chunk 0 - 0 + -1 0 0 <undefined> @@ -43,8 +43,8 @@ for(var xx = 0; xx < CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE) continue; var inst = instance_create(x+xx,y+yy, obj_black_hole); inst.CHUNK_CONTAINED = self.id; - ds_list_add(instance_list, inst); + hasGeneratedBlackHole = true; continue; } @@ -82,12 +82,47 @@ for(var xx = 0; xx < CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE) 1 var chunk_total_size = CHUNK_SIZE * TILE_SIZE -visible = global.debug if(distance_to_object(obj_player) > chunk_total_size*3) { event_user(0); } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Place items +var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot]; +if(selected_item != 0) +{ + use_item_in_inventory(obj_hotbar.selected_slot); + + var inst = instance_create(round(mouse_x/TILE_SIZE)*TILE_SIZE,round(mouse_y/TILE_SIZE)*TILE_SIZE,obj_placed_item); + var chunkid = id; + with(inst){ + inst.ITEM_ID = selected_item; + inst.CHUNK_CONTAINED = chunkid; + } + ds_list_add(instance_list, inst); +} @@ -146,6 +181,39 @@ for(var i = 0; i < ds_list_size(instance_list); i++) } loaded = false; instance_deactivate_object(id); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + if(global.debug) + draw_self(); + +var selX = round(mouse_x/TILE_SIZE)*TILE_SIZE; +var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE; +selX -= TILE_SIZE / 2; +selY -= TILE_SIZE / 2; + +draw_set_color(c_white); +draw_rectangle(selX,selY,selX + TILE_SIZE, selY + TILE_SIZE, true); + diff --git a/objects/obj_dropped_item.object.gmx b/objects/obj_dropped_item.object.gmx index ac1d27a..e2457fa 100644 --- a/objects/obj_dropped_item.object.gmx +++ b/objects/obj_dropped_item.object.gmx @@ -5,7 +5,7 @@ -1 0 0 - self + <undefined> <undefined> @@ -72,6 +72,7 @@ alarm[0] = 5*60*room_speed; 1 pull_towards_black_holes(); +image_index = item_id; var distance = distance_to_point(obj_player.x,obj_player.y) if(distance <= 100) diff --git a/objects/obj_hotbar.object.gmx b/objects/obj_hotbar.object.gmx index fa13e91..7547257 100644 --- a/objects/obj_hotbar.object.gmx +++ b/objects/obj_hotbar.object.gmx @@ -67,6 +67,54 @@ if((mouse_x >= x && mouse_x <= x+424) && (mouse_y >= y } } + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + selected_slot --; +selected_slot = selected_slot % 9; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + selected_slot ++; +selected_slot = selected_slot % 9; diff --git a/objects/obj_inventory.object.gmx b/objects/obj_inventory.object.gmx index 2ba3161..800be95 100644 --- a/objects/obj_inventory.object.gmx +++ b/objects/obj_inventory.object.gmx @@ -168,7 +168,7 @@ for(yy = 8; yy < (5*44); yy+=45) if(selected_item != 0) { - draw_sprite(spr_blocks,selected_item,mouse_x-16,mouse_y-16); + draw_sprite(spr_blocks,selected_item,mouse_x-(TILE_SIZE/2),mouse_y-(TILE_SIZE/2)); } diff --git a/objects/obj_dropped_stone.object.gmx b/objects/obj_placed_item.object.gmx similarity index 52% rename from objects/obj_dropped_stone.object.gmx rename to objects/obj_placed_item.object.gmx index efbe5ba..cb7d13e 100644 --- a/objects/obj_dropped_stone.object.gmx +++ b/objects/obj_placed_item.object.gmx @@ -5,7 +5,7 @@ -1 0 0 - obj_dropped_item + obj_chunk_item <undefined> @@ -25,13 +25,59 @@ 1 - image_xscale = 0.5; -image_yscale = 0.5; -image_speed = 0; - -item_id = STONE; -image_index = item_id; + image_speed = 0; +ITEM_ID = 0; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + var my_item_id = ITEM_ID; +with(instance_create(x,y,obj_dropped_item)) +{ + item_id = my_item_id +} + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + image_index = ITEM_ID; diff --git a/objects/obj_player.object.gmx b/objects/obj_player.object.gmx index d195ec5..66e4b4d 100644 --- a/objects/obj_player.object.gmx +++ b/objects/obj_player.object.gmx @@ -161,6 +161,37 @@ if(invuln_counter != invuln_counter_max) 1 ///pull_towards_black_holes(); pull_towards_black_holes(); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + damage_player(5); +instance_create(other.x,other.y,obj_boom_fx); + + +speed = -20; + + + + diff --git a/objects/obj_respawn.object.gmx b/objects/obj_respawn.object.gmx index d718796..b8b31ec 100644 --- a/objects/obj_respawn.object.gmx +++ b/objects/obj_respawn.object.gmx @@ -93,6 +93,7 @@ instance_destroy(self); 1 draw_self(); +draw_set_color(c_white); draw_text(x-string_width(BUTTON_TEXT)/2,y-5,BUTTON_TEXT); diff --git a/scripts/use_item_in_inventory.gml b/scripts/use_item_in_inventory.gml new file mode 100644 index 0000000..82e9bc2 --- /dev/null +++ b/scripts/use_item_in_inventory.gml @@ -0,0 +1,12 @@ +///use_item_in_inventory(slot) + +var slotno = argument0; +var count = obj_inv_controller.inventoryCount[slot]; +count--; +obj_inv_controller.inventoryCount[slot] = count; +if(count <= 0) +{ + obj_inv_controller.inventory[slot] = 0; + obj_inv_controller.inventoryCount[slot] = 0; +} +