CommitLog |

This commit is contained in:
SilicaAndPina 2020-07-25 00:24:30 +12:00
parent a951c8908b
commit 5519e5bf70
18 changed files with 565 additions and 26 deletions

View File

@ -18,11 +18,18 @@
<sprite>sprites\spr_asteroid</sprite>
<sprite>sprites\spr_boom</sprite>
<sprite>sprites\spr_chunk</sprite>
<sprites name="menus">
<sprite>sprites\spr_gameover</sprite>
<sprite>sprites\spr_button</sprite>
</sprites>
</sprites>
<backgrounds name="background">
<background>background\bg_space</background>
</backgrounds>
<paths name="paths"/>
<scripts name="scripts">
<script>scripts\damage_player.gml</script>
</scripts>
<objects name="objects">
<object>objects\obj_player</object>
<object>objects\obj_controller_world_gen</object>
@ -32,6 +39,11 @@
<object>objects\obj_chunk</object>
<object>objects\obj_boom_fx</object>
<object>objects\obj_chunk_item</object>
<objects name="menus">
<object>objects\obj_button</object>
<object>objects\obj_respawn</object>
<object>objects\obj_gameover_overlay</object>
</objects>
</objects>
<rooms name="rooms">
<room>rooms\rm_game</room>

View File

@ -30,7 +30,33 @@ image_index = random_range(0,1);
angle = random_range(0,180);
direction = angle;
image_angle = angle;
//speed = 1;
</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>if(speed &gt; 0)
{
speed -= 1
}
</string>
</argument>
</arguments>

View File

@ -3,7 +3,7 @@
<spriteName>spr_boom</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-60</depth>
<depth>-200</depth>
<persistent>0</persistent>
<parentName>&lt;undefined&gt;</parentName>
<maskName>&lt;undefined&gt;</maskName>

View File

@ -51,7 +51,7 @@ image_speed = 0;
<kind>1</kind>
<string>step_counter ++;
if(step_counter == 60*room_speed)
if(step_counter == 60*room_speed || instance_position(x,y,obj_chunk) == noone)
{
instance_destroy(self);
}

View File

@ -0,0 +1,94 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>spr_button</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-100</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>image_speed = 0;
BUTTON_TEXT = "";
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" enumb="11">
<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 = 0
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" enumb="10">
<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 = 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

@ -34,10 +34,10 @@ for(var xx = 0; xx &lt; CHUNK_SIZE*TILE_SIZE; xx+= TILE_SIZE)
{
for(var yy = 0; yy &lt; CHUNK_SIZE*TILE_SIZE; yy+= TILE_SIZE)
{
if(random_range(0,100) &lt; 5)
if(random_range(0,100) &lt; 1)
{
var inst = instance_create(x+xx,y+yy, obj_asteriod);
inst.CHUNK_CONTAINED = id;
inst.CHUNK_CONTAINED = self.id;
ds_list_add(instance_list, inst);
}

View File

@ -27,6 +27,38 @@
<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>
<event eventtype="3" enumb="2">
<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 curChunk = instance_position(x,y,obj_chunk);
if(curChunk != CHUNK_CONTAINED &amp;&amp; curChunk != noone)
{
show_debug_message("Moving chunks.");
var indx = ds_list_find_index(CHUNK_CONTAINED.instance_list,id);
ds_list_delete(CHUNK_CONTAINED.instance_list,indx);
CHUNK_CONTAINED = curChunk;
ds_list_add(curChunk.instance_list,id);
}
</string>
</argument>
</arguments>

View File

@ -25,14 +25,13 @@
<arguments>
<argument>
<kind>1</kind>
<string>step_counter = 0;
global.debug = false
<string>global.debug = false
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="3" enumb="0">
<event eventtype="8" enumb="64">
<action>
<libid>1</libid>
<id>603</id>
@ -49,14 +48,21 @@ global.debug = false
<arguments>
<argument>
<kind>1</kind>
<string>/// Every Frame Global Code.
step_counter++;
<string>/// Draw HUD
if(!global.debug)
{
draw_set_color(c_white);
draw_healthbar(10,10,500,30,(obj_player.energy/obj_player.energy_max)*100,c_gray,c_yellow,c_blue,0,true,false);
draw_text(11,13,string(obj_player.energy)+" / "+string(obj_player.energy_max));
draw_healthbar(10,40,300,60,(obj_player.hp/obj_player.hp_max)*100,c_gray,c_red,c_green,0,true,false);
draw_text(11,43,string(obj_player.hp)+" / "+string(obj_player.hp_max));
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="8" enumb="64">
<action>
<libid>1</libid>
<id>603</id>
@ -112,6 +118,7 @@ if(chunkX == 0 &amp;&amp; (playX &lt; 0 &amp;&amp; playX &gt;= chunk_total_size/
draw_text(10,10,"X: "+string(obj_player.x)+"#Y: "+string(obj_player.y));
draw_text(10,40,"CrX: "+string(chunkRelX)+"#CrY: "+string(chunkRelY));
draw_text(10,70,"CX: "+string(chunkX)+"#CY: "+string(chunkY));
draw_text(10,100,"Invuln: "+string(obj_player.invuln_counter));
}
</string>
</argument>

View File

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

@ -28,7 +28,16 @@
<string>/// Player creation code.
image_speed = 0;
image_index = 1;
is_moving = false;
dead = false;
invuln_counter_max = 1*room_speed;
invuln_counter = invuln_counter_max;
energy_max = 500;
energy = energy_max
hp_max = 100;
hp = hp_max;
</string>
</argument>
</arguments>
@ -52,16 +61,112 @@ image_index = 1;
<argument>
<kind>1</kind>
<string>/// Player per frame
if(dead == true)
{
return 0;
}
if(hp &lt;= 0)
{
speed = 0;
direction = 0;
audio_stop_all();
audio_play_sound(snd_boom,10,false);
sprite_index = spr_boom;
image_speed = 1;
hp = -1;
dead = true
}
direction = image_angle
if(speed &lt; 0)
{
speed += 1;
}
if(speed &gt; 0)
{
speed -= 1
if(speed &gt; 20)
speed = 20;
}
if(energy &gt;= 10 &amp;&amp; is_moving &amp;&amp; keyboard_check(vk_shift))
{
if(speed &gt; 30)
{
speed = 30;
}
energy -= 10;
}
else
{
if(speed &gt; 20)
{
speed = 20;
}
}
view_xview[0] = x - view_wview[0]/2;
view_yview[0] = y - view_hview[0]/2;
if(!is_moving)
{
if(energy &lt; energy_max)
{
energy += 5;
}
}
if(invuln_counter == invuln_counter_max)
{
visible = true;;
}
if(invuln_counter != invuln_counter_max)
{
if(invuln_counter % 5 == 0)
{
visible = !visible;
}
invuln_counter ++;
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="4" ename="obj_asteriod">
<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);
other.direction = direction;
other.image_angle = image_angle;
other.speed = 20;
speed = -20;
</string>
</argument>
</arguments>
@ -84,7 +189,12 @@ view_yview[0] = y - view_hview[0]/2;
<arguments>
<argument>
<kind>1</kind>
<string>direction = image_angle
<string>if(dead == true || speed &lt; 0)
{
return 0;
}
direction = image_angle
speed += 5
</string>
@ -109,7 +219,12 @@ speed += 5
<arguments>
<argument>
<kind>1</kind>
<string>image_angle -= 5;
<string>if(dead == true)
{
return 0;
}
image_angle -= 5;
</string>
</argument>
</arguments>
@ -132,7 +247,12 @@ speed += 5
<arguments>
<argument>
<kind>1</kind>
<string>image_angle += 5;
<string>if(dead == true)
{
return 0;
}
image_angle += 5;
</string>
</argument>
</arguments>
@ -155,11 +275,54 @@ speed += 5
<arguments>
<argument>
<kind>1</kind>
<string>var new_bullet = instance_create(x,y,obj_bullet);
audio_play_sound(snd_shoot,2,false);
new_bullet.image_angle = image_angle;
new_bullet.direction = image_angle;
new_bullet.speed = speed + 5;
<string>if(dead == true)
{
return 0;
}
if(energy &gt;= 20)
{
var new_bullet = instance_create(x,y,obj_bullet);
audio_play_sound(snd_shoot,2,false);
new_bullet.image_angle = image_angle;
new_bullet.direction = image_angle;
new_bullet.speed = speed + 5;
energy -= 20;
}
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="7">
<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(dead == false)
{
return 0;
}
obj_controller.visible = false;
image_speed = 0;
visible = false;
instance_create(view_xview[0]+(view_wview[0]/2),view_yview[0]+(view_hview[0]/2),obj_gameover_overlay);
instance_create(view_xview[0]+(view_wview[0]/2),view_yview[0]+(view_hview[0]/2),obj_respawn);
</string>
</argument>
@ -183,7 +346,13 @@ new_bullet.speed = speed + 5;
<arguments>
<argument>
<kind>1</kind>
<string>audio_play_sound(snd_engine,1,true);
<string>if(dead == true)
{
return 0;
}
is_moving = true;
audio_play_sound(snd_engine,1,true);
image_index = 0;
</string>
</argument>
@ -207,7 +376,13 @@ image_index = 0;
<arguments>
<argument>
<kind>1</kind>
<string>audio_stop_sound(snd_engine)
<string>if(dead == true)
{
return 0;
}
is_moving = false;
audio_stop_sound(snd_engine)
image_index = 1;
</string>
</argument>

View File

@ -0,0 +1,111 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>spr_button</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>-100</depth>
<persistent>0</persistent>
<parentName>obj_button</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>image_speed = 0;
BUTTON_TEXT = "Respawn";
show_debug_message("Button Created: "+BUTTON_TEXT);
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="6" 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>obj_player.x = obj_player.xstart;
obj_player.y = obj_player.ystart;
obj_player.energy = obj_player.energy_max;
obj_player.hp = obj_player.hp_max;
obj_player.dead = false;
obj_player.visible = true;
obj_player.image_speed = 0;
obj_player.sprite_index = spr_player;
obj_controller.visible = true;
instance_destroy(obj_gameover_overlay);
instance_destroy(self);
</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>draw_self();
draw_text(x-string_width(BUTTON_TEXT)/2,y-5,BUTTON_TEXT);
</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

@ -0,0 +1,8 @@
///damage_player(amount)
if(invuln_counter == invuln_counter_max)
{
hp -= argument0;
invuln_counter = 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,26 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<sprite>
<type>0</type>
<xorig>200</xorig>
<yorigin>16</yorigin>
<colkind>1</colkind>
<coltolerance>0</coltolerance>
<sepmasks>0</sepmasks>
<bboxmode>0</bboxmode>
<bbox_left>0</bbox_left>
<bbox_right>399</bbox_right>
<bbox_top>0</bbox_top>
<bbox_bottom>31</bbox_bottom>
<HTile>0</HTile>
<VTile>0</VTile>
<TextureGroups>
<TextureGroup0>0</TextureGroup0>
</TextureGroups>
<For3D>0</For3D>
<width>400</width>
<height>32</height>
<frames>
<frame index="0">images\spr_button_0.png</frame>
<frame index="1">images\spr_button_1.png</frame>
</frames>
</sprite>

View File

@ -0,0 +1,25 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<sprite>
<type>0</type>
<xorig>960</xorig>
<yorigin>540</yorigin>
<colkind>1</colkind>
<coltolerance>0</coltolerance>
<sepmasks>0</sepmasks>
<bboxmode>0</bboxmode>
<bbox_left>0</bbox_left>
<bbox_right>1919</bbox_right>
<bbox_top>0</bbox_top>
<bbox_bottom>1079</bbox_bottom>
<HTile>0</HTile>
<VTile>0</VTile>
<TextureGroups>
<TextureGroup0>0</TextureGroup0>
</TextureGroups>
<For3D>0</For3D>
<width>1920</width>
<height>1080</height>
<frames>
<frame index="0">images\spr_gameover_0.png</frame>
</frames>
</sprite>