CommitLog |
This commit is contained in:
parent
616cdab1b6
commit
d89ee661bb
38 changed files with 208 additions and 42 deletions
|
@ -5,7 +5,7 @@
|
|||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>0</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<parentName>obj_chunk_item</parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="0" enumb="0">
|
||||
|
|
63
objects/obj_boom_fx.object.gmx
Normal file
63
objects/obj_boom_fx.object.gmx
Normal file
|
@ -0,0 +1,63 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName>spr_boom</spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>-60</depth>
|
||||
<persistent>0</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<event eventtype="0" 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>audio_play_sound(snd_boom,3,false);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
<event eventtype="7" enumb="7">
|
||||
<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>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
|
||||
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
|
||||
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
|
||||
<PhysicsShapePoints/>
|
||||
</object>
|
|
@ -63,31 +63,26 @@ if(step_counter == 60*room_speed)
|
|||
<event eventtype="4" ename="obj_asteriod">
|
||||
<action>
|
||||
<libid>1</libid>
|
||||
<id>203</id>
|
||||
<kind>0</kind>
|
||||
<id>603</id>
|
||||
<kind>7</kind>
|
||||
<userelative>0</userelative>
|
||||
<isquestion>0</isquestion>
|
||||
<useapplyto>-1</useapplyto>
|
||||
<exetype>1</exetype>
|
||||
<functionname>action_kill_object</functionname>
|
||||
<codestring></codestring>
|
||||
<whoName>other</whoName>
|
||||
<relative>0</relative>
|
||||
<isnot>0</isnot>
|
||||
</action>
|
||||
<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>
|
||||
<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>
|
||||
</action>
|
||||
</event>
|
||||
</events>
|
||||
|
|
|
@ -26,10 +26,7 @@
|
|||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>/// GENERATE CHUNK
|
||||
var total_size = CHUNK_SIZE*TILE_SIZE;
|
||||
|
||||
instance_list = array_create(total_size);
|
||||
cur_inst = 0;
|
||||
instance_list = ds_list_create();
|
||||
loaded = true;
|
||||
|
||||
// GENERATION
|
||||
|
@ -37,10 +34,12 @@ for(var xx = 0; xx < CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE)
|
|||
{
|
||||
for(var yy = 0; yy < CHUNK_SIZE*TILE_SIZE; yy+= TILE_SIZE)
|
||||
{
|
||||
if(random_range(0,100) > 50)
|
||||
if(random_range(0,100) < 5)
|
||||
{
|
||||
instance_list[cur_inst] = instance_create(x+xx,y+yy, obj_asteriod);
|
||||
cur_inst ++;
|
||||
var inst = instance_create(x+xx,y+yy, obj_asteriod);
|
||||
inst.CHUNK_CONTAINED = id;
|
||||
|
||||
ds_list_add(instance_list, inst);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -98,9 +97,9 @@ if(distance_to_object(obj_player) > chunk_total_size*3)
|
|||
<kind>1</kind>
|
||||
<string>/// load
|
||||
|
||||
for(var i = 0; i < cur_inst; i++)
|
||||
for(var i = 0; i < ds_list_size(instance_list); i++)
|
||||
{
|
||||
instance_activate_object(instance_list[i]);
|
||||
instance_activate_object(instance_list[| i]);
|
||||
}
|
||||
loaded = true;
|
||||
</string>
|
||||
|
@ -126,12 +125,11 @@ loaded = true;
|
|||
<argument>
|
||||
<kind>1</kind>
|
||||
<string>/// unload
|
||||
for(var i = 0; i < cur_inst; i++)
|
||||
for(var i = 0; i < ds_list_size(instance_list); i++)
|
||||
{
|
||||
instance_deactivate_object(instance_list[i]);
|
||||
instance_deactivate_object(instance_list[| i]);
|
||||
}
|
||||
loaded = false;
|
||||
show_debug_message("Unloading chunk: "+string(x)+","+string(y));
|
||||
instance_deactivate_object(id);
|
||||
</string>
|
||||
</argument>
|
||||
|
|
48
objects/obj_chunk_item.object.gmx
Normal file
48
objects/obj_chunk_item.object.gmx
Normal file
|
@ -0,0 +1,48 @@
|
|||
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
|
||||
<object>
|
||||
<spriteName><undefined></spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<persistent>0</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
<events>
|
||||
<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 indx = ds_list_find_index(CHUNK_CONTAINED.instance_list,id);
|
||||
ds_list_delete(CHUNK_CONTAINED.instance_list,indx);
|
||||
</string>
|
||||
</argument>
|
||||
</arguments>
|
||||
</action>
|
||||
</event>
|
||||
</events>
|
||||
<PhysicsObject>0</PhysicsObject>
|
||||
<PhysicsObjectSensor>0</PhysicsObjectSensor>
|
||||
<PhysicsObjectShape>0</PhysicsObjectShape>
|
||||
<PhysicsObjectDensity>0.5</PhysicsObjectDensity>
|
||||
<PhysicsObjectRestitution>0.100000001490116</PhysicsObjectRestitution>
|
||||
<PhysicsObjectGroup>0</PhysicsObjectGroup>
|
||||
<PhysicsObjectLinearDamping>0.100000001490116</PhysicsObjectLinearDamping>
|
||||
<PhysicsObjectAngularDamping>0.100000001490116</PhysicsObjectAngularDamping>
|
||||
<PhysicsObjectFriction>0.200000002980232</PhysicsObjectFriction>
|
||||
<PhysicsObjectAwake>-1</PhysicsObjectAwake>
|
||||
<PhysicsObjectKinematic>0</PhysicsObjectKinematic>
|
||||
<PhysicsShapePoints/>
|
||||
</object>
|
|
@ -32,14 +32,12 @@ for(var i = 0; i < 16; i ++)
|
|||
var chunkat = instance_position(cX[i], cY[i],obj_chunk);
|
||||
if(chunkat == noone) // create
|
||||
{
|
||||
show_debug_message("Generating chunk: "+string(cX[i])+","+string(cY[i]));
|
||||
instance_create(cX[i],cY[i],obj_chunk);
|
||||
}
|
||||
else // load
|
||||
{
|
||||
if(chunkat.loaded = false)
|
||||
{
|
||||
show_debug_message("Loading chunk: #"+string(chunkat)+" "+string(cX[i])+","+string(cY[i]));
|
||||
with(chunkat){
|
||||
event_user(1);
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<spriteName>spr_player</spriteName>
|
||||
<solid>0</solid>
|
||||
<visible>-1</visible>
|
||||
<depth>0</depth>
|
||||
<depth>-100</depth>
|
||||
<persistent>0</persistent>
|
||||
<parentName><undefined></parentName>
|
||||
<maskName><undefined></maskName>
|
||||
|
|
Reference in a new issue