Needed 1 final readability revision after having actually read the contribution guidelines

pull/91/head
Zackonark 5 years ago
parent 9bd2d36af6
commit da43d80dbc

@ -4329,12 +4329,12 @@
</scripts>
<scripts name="Zacko">
<script>scripts\scrConsoleInit.gml</script>
<script>scripts\scrConsoleCommandRun.gml</script>
<script>scripts\scrConsoleCommandAdd.gml</script>
<script>scripts\scrConsoleMain.gml</script>
<script>scripts\scrConsoleCleanup.gml</script>
<script>scripts\scrConsoleHistoryUpdate.gml</script>
<script>scripts\scrConsolePrint.gml</script>
<script>scripts\console_command_add.gml</script>
<script>scripts\console_command_run.gml</script>
<script>scripts\console_history_update.gml</script>
<script>scripts\console_print.gml</script>
</scripts>
</scripts>
<shaders name="shaders">

@ -65,11 +65,15 @@ sparkcounter = 0;
//~TIMING~//
enum BOSS1_ATTACKTIME {
Initial = 120,
Normal = 90
INITIAL = 120,
NORMAL = 90
}
//these didn't work right after the refactor
//I think I made him too efficient lol
/*
enum BOSS1_INTRO { //old times
MoveTiles0 = 60,
MoveTiles1 = 92,
@ -80,28 +84,29 @@ enum BOSS1_INTRO { //old times
Animate = 220,
ToNormal = 280
}
*/
enum BOSS1_INTRO {
MoveTiles0 = 60,
MoveTiles1 = 92,
PlayMusic = 90,
FadeIn = 120,
ScanEvent = 150,
Quake = 160,
Animate = 180,
ToNormal = 200
MOVETILES0 = 60,
MOVETILES1 = 92,
PLAYMUSIC = 90,
FADEIN = 120,
SCANEVENT = 150,
QUAKE = 160,
ANIMATE = 180,
TONORMAL = 200
}
enum BOSS1_ATTACK {
EyeFlash = 5,
Attack = 80,
ToNormal = 120
EYEFLASH = 5,
ATTACK = 80,
TONORMAL = 120
}
enum BOSS1_DEATH {
Burn = 1,
Explode = 250
BURN = 1,
EXPLODE = 250
}
@ -136,7 +141,9 @@ EdgeStepAmount = 16;
<arguments>
<argument>
<kind>1</kind>
<string>expl = instance_create(x - 16 + random(32), y - 8 + random(24), oFXAnimSpark);
<string>///Burn Timer
expl = instance_create(x - 16 + random(32), y - 8 + random(24), oFXAnimSpark);
expl.image_speed = 0.5;
expl.additive = 0;
expl.sprite_index = sExpl1;
@ -164,7 +171,9 @@ alarm[1] = 5;
<arguments>
<argument>
<kind>1</kind>
<string>if (state == 1) {
<string>///Attack Timer
if (state == 1) {
state = 2;
statetime = 0;
@ -199,7 +208,6 @@ alarm[1] = 5;
wall1.x = edge_l - 64;
wall2.x = edge_r + 32;
//why is this here if collision tiles exist for these walls?
with (oCharacter) {
if (x &lt; oBoss1Head.edge_l - 16) x = oBoss1Head.edge_l - 16;
if (x &gt; oBoss1Head.edge_r + 16) x = oBoss1Head.edge_r + 16;
@ -241,194 +249,6 @@ if (fxtimer &lt; 5) {
fxtimer += 1;
} else fxtimer = 0;
if (flashing &gt; 0) flashing -= 1;
//old code//
/*if (state == 0) {
if (statetime == 90) {
mus_play(musAncientGuardian);
oMusicV2.bossbgm = musAncientGuardian;
}
if (statetime &gt; 60 &amp;&amp; statetime &lt;= 92) {
tile_layer_shift(-99, -1, 0);
tile_layer_shift(-98, 1, 0);
}
if (statetime &gt; 120 &amp;&amp; image_alpha &lt; 1) image_alpha += 0.05;
if (statetime == 120) sfx_play(sndBoss1Appear);
if (statetime &gt; 150 &amp;&amp; y &lt; 64) y += 0.5;
if (statetime == 150) scan_log(32, get_text("ScanEvents", "ScanMechanism"), 180, 0);
if (statetime == 210) {
quake = instance_create(0, 0, oQuake);
quake.delay = 0;
quake.duration = 10;
quake.intensity = 2;
}
if (statetime &gt; 220 &amp;&amp; floor(image_index) &lt; 5) image_index += 0.2;
if (statetime == 280) {
state = 1;
statetime = 0;
canbehit = 1;
alarm[0] = AttackTime[0];
image_index = 5;
}
} // if (state == 0)
if (state == 1) {
hitbeam = 1;
hitmissile = 1;
hitbomb = 1;
hitpbomb = 1;
if (image_index &gt; 5) image_index -= 0.5;
if (x &gt; oCharacter.x) hspeed -= 0.1;
if (x &lt; oCharacter.x) hspeed += 0.1;
if (x &lt; edge_l &amp;&amp; hspeed &lt; 0) hspeed = 0;
if (x &gt; edge_r &amp;&amp; hspeed &gt; 0) hspeed = 0;
if (hspeed &gt; 3) hspeed = 3;
if (hspeed &lt; -3) hspeed = -3;
if (myhealth &lt; 600) {
edge_l = 80;
edge_r = 240;
phase = 1;
movetime = 90;
}
if (myhealth &lt; 500) {
edge_l = 96;
edge_r = 224;
phase = 2;
movetime = 70;
}
if (myhealth &lt; 450) {
edge_l = 112;
edge_r = 208;
phase = 3;
movetime = 60;
}
if (myhealth &lt; 300) {
edge_l = 128;
edge_r = 192;
phase = 4;
movetime = 50;
}
if (myhealth &lt; 150) {
edge_l = 144;
edge_r = 176;
phase = 5;
movetime = 30;
}
} // if (state == 1)
if (state == 2) {
speed = 0;
hitbeam = 0;
hitmissile = 0;
hitbomb = 0;
hitpbomb = 0;
/* if (statetime == 1) {
attack = floor(random(4));
if (phase &gt;= 4) {
if (attack == 0) attack = 2;
}
}
if (image_index &lt; 9) image_index += 0.25;
if (statetime == 5) {
eyes = instance_create(x, y, oBoss1Eyes); // og y + 14
eyes.image_index = attack;
if (attack == 0) sfx_play(sndBoss1Eyes2);
if (attack == 1) sfx_play(sndBoss1Eyes1);
if (attack == 2) sfx_play(sndBoss1Eyes4);
if (attack == 3) sfx_play(sndBoss1Eyes3);
}
if (statetime == 80) {
if (attack == 0) {
instance_create(x, y + 12, oBoss1FBall);
sfx_play(sndBoss1FBall);
}
if (attack == 1) {
prj1 = instance_create(x + 4, y + 18, oBoss1FBall2);
prj2 = instance_create(x - 4, y + 18, oBoss1FBall2);
prj3 = instance_create(x + 4, y + 18, oBoss1FBall2);
prj4 = instance_create(x - 4, y + 18, oBoss1FBall2);
prj5 = instance_create(x + 4, y + 18, oBoss1FBall2);
prj6 = instance_create(x - 4, y + 18, oBoss1FBall2);
prj1.hspeed = 3;
prj2.hspeed = -3;
prj3.hspeed = 6;
prj4.hspeed = -6;
prj5.hspeed = 9;
prj6.hspeed = -9;
sfx_play(sndBoss1FBall);
}
if (attack == 2) {
prj1 = instance_create(x + 6, y + 11, oBoss1Beam);
prj2 = instance_create(x - 6, y + 11, oBoss1Beam);
prj1.image_xscale = -1;
sfx_play(sndBoss1Laser);
}
if (attack == 3) {
prj1 = instance_create(x + 4, y + 18, oBoss1FBall3);
prj2 = instance_create(x - 4, y + 18, oBoss1FBall3);
prj3 = instance_create(x + 4, y + 18, oBoss1FBall3);
prj4 = instance_create(x - 4, y + 18, oBoss1FBall3);
prj5 = instance_create(x + 4, y + 18, oBoss1FBall3);
prj6 = instance_create(x - 4, y + 18, oBoss1FBall3);
prj1.hspeed = 0.4;
prj1.time = 60;
prj2.hspeed = -0.4;
prj2.time = 70;
prj3.hspeed = 1.2;
prj3.time = 80;
prj4.hspeed = -1.2;
prj4.time = 90;
prj5.hspeed = 2;
prj5.time = 100;
prj6.hspeed = -2;
prj6.time = 110;
sfx_play(sndBoss1FBall);
}
} // if (statetime == 80)
if (statetime == 120) {
state = 1;
alarm[0] = AttackTime[1];
}
} // if (state == 2)
if (state == 100) {
speed = 0;
canbehit = 0;
if (statetime == 1) {
alarm[1] = 1;
/* sfx_play(sndBoss1Death);
with (wall1) instance_destroy();
with (wall2) instance_destroy();
with (wheel) instance_destroy();
with (block1) event_user(0);
with (block2) event_user(0);
with (inst_107511) instance_destroy();
global.event[51] = 1;
mus_fadeout(musAncientGuardian);
oMusicV2.bossbgm = sndJump;
mus_current_fadein();
event_user(5);
}
if (statetime == 250) {
repeat (10) {
expl = instance_create(x - 16 + random(32), y - 16 + random(32), oFXAnimSpark);
expl.image_speed = 0.5 + random(0.5);
expl.additive = 0;
expl.sprite_index = sExpl1;
expl.direction = 180 + random(180);
expl.speed = 2 + random(1);
}
repeat (10) make_explosion3(x + random_range(-30, 30), y + random_range(-30, 30));
repeat (60) instance_create(x, y + 28, oDebris);
spawn_many_powerups(128, 80, 64, 64);
instance_create(x, y, oScreenFlash);
sfx_play(sndBoss1Stomp);
sfx_play(sndSMissileExpl);
quake = instance_create(0, 0, oQuake);
quake.delay = 0;
quake.duration = 15;
quake.intensity = 8;
instance_destroy();
}
} // if (state == 100)*/
</string>
</argument>
</arguments>
@ -486,7 +306,7 @@ hitbeam = 1;
hitmissile = 1;
hitbomb = 1;
hitpbomb = 1;
alarm[0] = BOSS1_ATTACKTIME.Initial;
alarm[0] = BOSS1_ATTACKTIME.NORMAL;
image_index = 5;
</string>
</argument>
@ -549,12 +369,12 @@ speed = 0;
canbehit = 0;
switch (statetime) {
case BOSS1_DEATH.Burn :
case BOSS1_DEATH.BURN :
alarm[1] = 1;
event_user(5);
break;
case BOSS1_DEATH.Explode :
case BOSS1_DEATH.EXPLODE :
repeat (10) {
expl = instance_create(x - 16 + random(32), y - 16 + random(32), oFXAnimSpark);
expl.image_speed = 0.5 + random(0.5);
@ -609,7 +429,7 @@ hitpbomb = 0;
if (image_index &lt; 9) image_index += 0.25;
switch (statetime) {
case BOSS1_ATTACK.EyeFlash : //Telegrah
case BOSS1_ATTACK.EYEFLASH : //Telegraph
eyes = instance_create(x, y, oBoss1Eyes); // og y + 14
eyes.image_index = attack;
switch (attack){
@ -620,7 +440,7 @@ switch (statetime) {
}
break;
case BOSS1_ATTACK.Attack : //Attack
case BOSS1_ATTACK.ATTACK : //Attack
switch (attack) {
case 0 : //Yellow Fire Ball
instance_create(x, y + 12, oBoss1FBall);
@ -675,7 +495,7 @@ switch (statetime) {
break;
case BOSS1_ATTACK.ToNormal : //To Normal State
case BOSS1_ATTACK.TONORMAL : //To Normal State
event_user(6);
break;
@ -745,44 +565,46 @@ if(phase &lt;= array_length_1d(PhaseProgression)){
<argument>
<kind>1</kind>
<string>///state: boss intro
//move tiles sideways
if (statetime &gt; BOSS1_INTRO.MoveTiles0 &amp;&amp; statetime &lt;= BOSS1_INTRO.MoveTiles1) {
if (statetime &gt; BOSS1_INTRO.MOVETILES0 &amp;&amp; statetime &lt;= BOSS1_INTRO.MOVETILES1) {
tile_layer_shift(-99, -1, 0);
tile_layer_shift(-98, 1, 0);
}
//fade in
if (statetime &gt; BOSS1_INTRO.FadeIn &amp;&amp; image_alpha &lt; 1) image_alpha += 0.05;
if (statetime &gt; BOSS1_INTRO.FADEIN &amp;&amp; image_alpha &lt; 1) image_alpha += 0.05;
//move down
if (statetime &gt; BOSS1_INTRO.PlayMusic &amp;&amp; y &lt; 64) y += 0.5;
if (statetime &gt; BOSS1_INTRO.PLAYMUSIC &amp;&amp; y &lt; 64) y += 0.5;
//animate
if (statetime &gt; BOSS1_INTRO.Animate &amp;&amp; floor(image_index) &lt; 5) image_index += 0.2;
if (statetime &gt; BOSS1_INTRO.ANIMATE &amp;&amp; floor(image_index) &lt; 5) image_index += 0.2;
switch(statetime){
case BOSS1_INTRO.PlayMusic : //play music
case BOSS1_INTRO.PLAYMUSIC : //play music
mus_play(musAncientGuardian);
oMusicV2.bossbgm = musAncientGuardian;
break;
case BOSS1_INTRO.FadeIn : //play appearance sound effect
case BOSS1_INTRO.FADEIN : //play appearance sound effect
sfx_play(sndBoss1Appear);
break;
case BOSS1_INTRO.ScanEvent : //trigger scan event
case BOSS1_INTRO.SCANEVENT : //trigger scan event
scan_log(32, get_text("ScanEvents", "ScanMechanism"), 180, 0);
break;
case BOSS1_INTRO.Quake : //trigger earthquake
case BOSS1_INTRO.QUAKE : //trigger earthquake
quake = instance_create(0, 0, oQuake);
quake.delay = 0;
quake.duration = 10;
quake.intensity = 2;
break;
case BOSS1_INTRO.ToNormal : //go to normal state
case BOSS1_INTRO.TONORMAL : //go to normal state
event_user(6);
alarm[0] = BOSS1_ATTACKTIME.INITIAL;
break;
default : break;

@ -1,139 +0,0 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<object>
<spriteName>sSaveSlotCopy</spriteName>
<solid>0</solid>
<visible>-1</visible>
<depth>0</depth>
<persistent>-1</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>scrConsoleInit();
</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>scrConsoleCleanup();
</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>scrConsoleMain();
</string>
</argument>
</arguments>
</action>
</event>
<event eventtype="7" enumb="3">
<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>scrConsoleCleanup();
</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>scrConsolePrint(x, y, font0, c_white, c_green, c_red);
</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>

@ -16,7 +16,7 @@ if(string_char_at(ConsoleEntry, 1) == CommandPrefix){
//output set as : "command (arg1 / arg2)"
//these will be listed as new lines in the ConsoleHistory list. I provided an easy means of scrolling the history with the arrow keys
//recommend disabling input collection when using this and/or switching the controls around
case COMMANDS.Help :
case COMMANDS.HELP :
if(ds_exists(ConsoleCommands, ds_type_map)){
var _commandKey = ds_map_find_first(ConsoleCommands);
@ -44,7 +44,7 @@ if(string_char_at(ConsoleEntry, 1) == CommandPrefix){
}
//write the command to the console
scrConsoleHistoryUpdate(_commandString);
console_history_update(_commandString);
_commandKey = ds_map_find_next(ConsoleCommands, _commandKey);
@ -56,12 +56,8 @@ if(string_char_at(ConsoleEntry, 1) == CommandPrefix){
break;
//toggles the debug boolean
//true sets it to true
//false sets it to false
//default swaps its current value
//like duhhh. I'm here treating you like you're 12 or sum shit
case COMMANDS.Debug :
//included as an example of a debug toggle
case COMMANDS.DEBUG :
/*if(CommandArg == _command[1]){ global.DEBUG = true;}
if(CommandArg == _command[2]){ global.DEBUG = false;}
if(CommandArg == ""){ global.DEBUG = !global.DEBUG;}*/

@ -28,9 +28,9 @@ ConsoleViewLine = 0; //the currently viewed past entry
ConsoleCommands = ds_map_create();
enum COMMANDS{
Help,
Debug
HELP,
DEBUG
}
scrConsoleCommandAdd(COMMANDS.Help, "help");
scrConsoleCommandAdd(COMMANDS.Debug, "debug", "true", "false");
console_command_add(COMMANDS.HELP, "help");
console_command_add(COMMANDS.DEBUG, "debug", "true", "false");

@ -1,4 +1,4 @@
//Run this method in any step event. no extra code is required for it to run as intended
//Run this script in any step event. no extra code is required for it to run as intended
//toggle the console
if(keyboard_check_pressed(global.CONSOLE_KEY)){
@ -55,9 +55,9 @@ if(global.CONSOLE){
//I made that easy with a simple global variable that toggles the console
case vk_enter :
scrConsoleCommandRun();
console_command_run();
scrConsoleHistoryUpdate(ConsoleEntry);
console_history_update(ConsoleEntry);
ConsoleEntry = "";
CommandName = "";
CommandArg = "";

Loading…
Cancel
Save