Commit Message

This commit is contained in:
SilicaAndPina 2020-07-29 13:22:35 +12:00
parent 2b60cde872
commit 88da5bc5f0
10 changed files with 271 additions and 13 deletions

View File

@ -54,7 +54,10 @@ image_angle = angle;
<arguments>
<argument>
<kind>1</kind>
<string>instance_create(x,y,obj_dropped_stone);
<string>with(instance_create(x,y,obj_dropped_item))
{
item_id = STONE;
}
</string>
</argument>
</arguments>
@ -85,6 +88,29 @@ if(speed &gt; 0)
pull_towards_black_holes();
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_placed_item">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>speed = -20;
</string>
</argument>
</arguments>

View File

@ -57,6 +57,31 @@ if(step_counter == 60*room_speed || instance_position(x,y,obj_chunk) == noone)
{
instance_destroy(self);
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_placed_item">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>instance_destroy(other);
instance_create(other.x,other.y,obj_boom_fx)
instance_destroy(id);
</string>
</argument>
</arguments>

View File

@ -2,7 +2,7 @@
<object>
<spriteName>spr_chunk</spriteName>
<solid>0</solid>
<visible>0</visible>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
@ -43,8 +43,8 @@ for(var xx = 0; xx &lt; 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 &lt; CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE)
<kind>1</kind>
<string>var chunk_total_size = CHUNK_SIZE * TILE_SIZE
visible = global.debug
if(distance_to_object(obj_player) &gt; chunk_total_size*3)
{
event_user(0);
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" enumb="5">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>///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);
}
</string>
</argument>
</arguments>
@ -146,6 +181,39 @@ for(var i = 0; i &lt; ds_list_size(instance_list); i++)
}
loaded = false;
instance_deactivate_object(id);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="8" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>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);
</string>
</argument>
</arguments>

View File

@ -5,7 +5,7 @@
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>self</parentName>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
@ -72,6 +72,7 @@ alarm[0] = 5*60*room_speed;
<argument>
<kind>1</kind>
<string>pull_towards_black_holes();
image_index = item_id;
var distance = distance_to_point(obj_player.x,obj_player.y)
if(distance &lt;= 100)

View File

@ -67,6 +67,54 @@ if((mouse_x &gt;= x &amp;&amp; mouse_x &lt;= x+424) &amp;&amp; (mouse_y &gt;= y
}
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" enumb="61">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>selected_slot --;
selected_slot = selected_slot % 9;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" enumb="60">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>selected_slot ++;
selected_slot = selected_slot % 9;
</string>
</argument>
</arguments>

View File

@ -168,7 +168,7 @@ for(yy = 8; yy &lt; (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));
}
</string>
</argument>

View File

@ -5,7 +5,7 @@
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>obj_dropped_item</parentName>
<parentName>obj_chunk_item</parentName>
<maskName>&lt;undefined&gt;</maskName>
<events>
<event eventtype="0" enumb="0">
@ -25,13 +25,59 @@
<arguments>
<argument>
<kind>1</kind>
<string>image_xscale = 0.5;
image_yscale = 0.5;
image_speed = 0;
item_id = STONE;
image_index = item_id;
<string>image_speed = 0;
ITEM_ID = 0;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="1" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>var my_item_id = ITEM_ID;
with(instance_create(x,y,obj_dropped_item))
{
item_id = my_item_id
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>image_index = ITEM_ID;
</string>
</argument>
</arguments>

View File

@ -161,6 +161,37 @@ if(invuln_counter != invuln_counter_max)
<kind>1</kind>
<string>///pull_towards_black_holes();
pull_towards_black_holes();
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_placed_item">
<action>
<libid>1</libid>
<id>603</id>
<kind>7</kind>
<userelative>0</userelative>
<isquestion>0</isquestion>
<useapplyto>-1</useapplyto>
<exetype>2</exetype>
<functionname></functionname>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
<arguments>
<argument>
<kind>1</kind>
<string>damage_player(5);
instance_create(other.x,other.y,obj_boom_fx);
speed = -20;
</string>
</argument>
</arguments>

View File

@ -93,6 +93,7 @@ instance_destroy(self);
<argument>
<kind>1</kind>
<string>draw_self();
draw_set_color(c_white);
draw_text(x-string_width(BUTTON_TEXT)/2,y-5,BUTTON_TEXT);
</string>

View File

@ -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;
}