Commit Message

This commit is contained in:
SilicaAndPina 2020-07-29 14:11:35 +12:00
parent 65013df7ed
commit baa19120e7
3 changed files with 34 additions and 9 deletions

View File

@ -110,29 +110,38 @@ if(distance_to_object(obj_player) > chunk_total_size*3)
<argument> <argument>
<kind>1</kind> <kind>1</kind>
<string>///Place items <string>///Place items
if(obj_inv_controller.is_open)
{
return 0;
}
var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot]; var selected_item = obj_inv_controller.inventory[obj_hotbar.selected_slot];
var has_colision = false;
if(selected_item != 0) if(selected_item != 0)
{ {
use_item_in_inventory(obj_hotbar.selected_slot);
var selX = round(mouse_x/TILE_SIZE)*TILE_SIZE; var selX = round(mouse_x/TILE_SIZE)*TILE_SIZE;
var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE; var selY = round(mouse_y/TILE_SIZE)*TILE_SIZE;
selX -= TILE_SIZE / 2; selX -= TILE_SIZE / 2;
selY -= TILE_SIZE / 2; selY -= TILE_SIZE / 2;
var has_colision = false;
for(var xx = selX; xx &lt; selX + TILE_SIZE; xx++) for(var xx = selX; xx &lt; selX + TILE_SIZE; xx++)
{ {
for(yy = selY; yy &lt; selY + TILE_SIZE; yy++) for(yy = selY; yy &lt; selY + TILE_SIZE; yy++)
{ {
var objid = instance_place(xx,yy,all) var objid = instance_place(xx,yy,obj_placed_item)
if(objid != noone &amp;&amp; objid.object_index != obj_chunk) if(objid != noone)
{ {
has_colision = true; 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 inst = instance_create(selX,selY,obj_placed_item);
var chunkid = id; var chunkid = id;
with(inst){ with(inst){

View File

@ -84,6 +84,22 @@ image_index = ITEM_ID;
</arguments> </arguments>
</action> </action>
</event> </event>
<event eventtype="4" ename="obj_black_hole">
<action>
<libid>1</libid>
<id>203</id>
<kind>0</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>1</exetype>
<functionname>action_kill_object</functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
</action>
</event>
</events> </events>
<PhysicsObject>0</PhysicsObject> <PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor> <PhysicsObjectSensor>0</PhysicsObjectSensor>

View File

@ -185,9 +185,9 @@ pull_towards_black_holes();
<kind>1</kind> <kind>1</kind>
<string>damage_player(5); <string>damage_player(5);
instance_create(other.x,other.y,obj_boom_fx); instance_create(other.x,other.y,obj_boom_fx);
image_angle += 180;
direction += 180;
speed = -20; speed = 20;