CommitLog |

This commit is contained in:
SilicaAndPina 2020-07-23 10:50:27 +12:00
parent ad28a64f2e
commit 2e6e2af246
8 changed files with 212 additions and 0 deletions

View File

@ -20,10 +20,15 @@
<background>background\bg_space</background>
</backgrounds>
<paths name="paths"/>
<scripts name="scripts">
<script>scripts\generate_world.gml</script>
</scripts>
<objects name="objects">
<object>objects\obj_player</object>
<object>objects\obj_controller_world_gen</object>
<object>objects\obj_controller</object>
<object>objects\obj_bullet</object>
<object>objects\obj_asteriod</object>
</objects>
<rooms name="rooms">
<room>rooms\rm_game</room>

View File

@ -0,0 +1,52 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>spr_asteroid</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</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>var angle = random_range(0,180);
direction = angle;
image_angle = angle;
speed = 1;
</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>

View File

@ -60,6 +60,36 @@ if(step_counter == 60*room_speed)
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_asteriod">
<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>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>
<codestring></codestring>
<whoName>self</whoName>
<relative>0</relative>
<isnot>0</isnot>
</action>
</event>
</events>
<PhysicsObject>0</PhysicsObject>
<PhysicsObjectSensor>0</PhysicsObjectSensor>

View File

@ -8,6 +8,52 @@
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</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>step_counter = 0;
</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>step_counter++;
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="9" enumb="122">
<action>
<libid>1</libid>

View File

@ -0,0 +1,49 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>&lt;undefined&gt;</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</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>generated_count = 0;
generated_areas = array_create(1000);
</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>

View File

@ -83,6 +83,7 @@ view_yview[0] = y - view_hview[0]/2;
<string>direction = image_angle
speed += 5
generate_world();
</string>
</argument>
</arguments>

View File

@ -53,6 +53,7 @@
<instances>
<instance objName="obj_player" x="512" y="512" name="inst_E89CF1B4" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
<instance objName="obj_controller" x="0" y="0" name="inst_12F93A6E" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
<instance objName="obj_controller_world_gen" x="32" y="0" name="inst_328268F5" locked="0" code="" scaleX="1" scaleY="1" colour="4294967295" rotation="0"/>
</instances>
<tiles/>
<PhysicsWorld>0</PhysicsWorld>

View File

@ -0,0 +1,28 @@
///Generate World Chunks
show_debug_message(obj_controller_world_gen.generated_count);
var xmax = obj_player.x - view_wview[0]/2;
var ymax = obj_player.y - view_hview[0]/2;
for(var xx = 0; xx < view_xview[0]+view_wview[0];xx+=32)
{
for(var yy = 0; yy < view_yview[0]+view_hview[0];yy+=32)
{ var expe = string(xx)+string(yy)
for(var i = 0; i <= obj_controller_world_gen.generated_count; i++)
{
if(obj_controller_world_gen.generated_areas[i] == expe)
{
return 0;
}
}
obj_controller_world_gen.generated_areas[obj_controller_world_gen.generated_count] = expe;
obj_controller_world_gen.generated_count ++;
if(random_range(0,10) > 5)
{
instance_create(xx,yy,obj_asteriod);
}
}
}