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

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