From baa19120e7a792f6b06eef3834ba85c0365dd446 Mon Sep 17 00:00:00 2001 From: SilicaAndPina Date: Wed, 29 Jul 2020 14:11:35 +1200 Subject: [PATCH] Commit Message --- objects/obj_chunk.object.gmx | 21 +++++++++++++++------ objects/obj_placed_item.object.gmx | 16 ++++++++++++++++ objects/obj_player.object.gmx | 6 +++--- 3 files changed, 34 insertions(+), 9 deletions(-) diff --git a/objects/obj_chunk.object.gmx b/objects/obj_chunk.object.gmx index 7b14ad1..015a121 100644 --- a/objects/obj_chunk.object.gmx +++ b/objects/obj_chunk.object.gmx @@ -110,29 +110,38 @@ if(distance_to_object(obj_player) > chunk_total_size*3) 1 ///Place items +if(obj_inv_controller.is_open) +{ + return 0; +} + var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot]; +var has_colision = false; + if(selected_item != 0) { - use_item_in_inventory(obj_hotbar.selected_slot); 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; - var has_colision = false; - for(var xx = selX; xx < selX + TILE_SIZE; xx++) { for(yy = selY; yy < selY + TILE_SIZE; yy++) { - var objid = instance_place(xx,yy,all) - if(objid != noone && objid.object_index != obj_chunk) + var objid = instance_place(xx,yy,obj_placed_item) + if(objid != noone) { has_colision = true; } } } - + if(has_colision) + { + return 0; + } + + use_item_in_inventory(obj_hotbar.selected_slot); var inst = instance_create(selX,selY,obj_placed_item); var chunkid = id; with(inst){ diff --git a/objects/obj_placed_item.object.gmx b/objects/obj_placed_item.object.gmx index 6d167c3..1a39432 100644 --- a/objects/obj_placed_item.object.gmx +++ b/objects/obj_placed_item.object.gmx @@ -84,6 +84,22 @@ image_index = ITEM_ID; + + + 1 + 203 + 0 + 0 + 0 + -1 + 1 + action_kill_object + + self + 0 + 0 + + 0 0 diff --git a/objects/obj_player.object.gmx b/objects/obj_player.object.gmx index 66e4b4d..a6cfb2d 100644 --- a/objects/obj_player.object.gmx +++ b/objects/obj_player.object.gmx @@ -185,9 +185,9 @@ pull_towards_black_holes(); 1 damage_player(5); instance_create(other.x,other.y,obj_boom_fx); - - -speed = -20; +image_angle += 180; +direction += 180; +speed = 20;