Skip to content

Commit

Permalink
Fixed a pausing bug where the player's position would be slightly shi…
Browse files Browse the repository at this point in the history
…fted;

Fixed a bug where Player 1 can't cancel in the Item Equip screen;
Initialized default Player 2 controls to prevent fatal crashes on initial game bootup;
Polished the start menu a bit to make it look more professional;
Renamed a few asset names for consistency and deleted unused ones;
Enemies now attempt to look for a new host if their current target is dead.
  • Loading branch information
mysterypaint committed Feb 5, 2017
1 parent b31957a commit db1282a
Show file tree
Hide file tree
Showing 55 changed files with 525 additions and 290 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ See it in action here: https://github.com/mysterypaint/Game-Maker-Studio-Shmup-E
This engine features:
- Dynamic game state system (Opening credits, titlescreen, game mode, pausing, cutscene mode, game over mode, "START" mode [The START window before the player gains control])
- The standard Gradius arsenal and HUD
- Co-Op Mode
- A fully playable level
- Game Loop system (increasing difficulty; infinite play)
- Window resizing hotkeys (1, 2, 3, Alt+Enter, Holding Esc closes game)
Expand All @@ -22,7 +23,8 @@ The engine also has many debug features (Press Q to toggle debug mode):
- R: Set X camera scroll to 0.3
- T: Increase the player's speed
- U: Trigger Kon.Code (Unlimited uses)
- I: Give the player a Speedup
- I: Give Player 1 a Speedup
- C: Give Player 2 a Speedup
- Numpad +/-: Increment/decrement player lives
- Right/Left-click: Change tile value the mouse is currently hovered over
- Shift+Right-click: Set tile on top of mouse's value to 0
Expand Down
19 changes: 10 additions & 9 deletions src/ShmupProj.project.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
<NewExtensions/>
<sounds name="sound">
<sounds name="bgm">
<sound>sound\BGM00</sound>
<sound>sound\BGM01</sound>
<sound>sound\BGM02</sound>
<sound>sound\BGM03</sound>
<sound>sound\musBoss1</sound>
<sound>sound\musFlight2</sound>
<sound>sound\musItemEquip</sound>
<sound>sound\musStage1</sound>
</sounds>
<sounds name="sfx">
<sound>sound\itsjoke</sound>
Expand Down Expand Up @@ -102,7 +102,7 @@
<sprite>sprites\sprTwinLaser</sprite>
<sprite>sprites\sprForceField</sprite>
</sprites>
<sprite>sprites\spr_crosshair</sprite>
<sprite>sprites\sprCrosshair</sprite>
<sprite>sprites\spr16x16</sprite>
<sprite>sprites\sprCapsule</sprite>
<sprite>sprites\sprCursor</sprite>
Expand All @@ -114,10 +114,10 @@
</sprites>
<backgrounds name="background">
<background>background\tileset0</background>
<background>background\sky1</background>
<background>background\sky2</background>
<background>background\sky3</background>
<background>background\weaponSelect</background>
<background>background\bkgSky1</background>
<background>background\bkgSky2</background>
<background>background\bkgSky3</background>
<background>background\bkgWeaponSelect</background>
</backgrounds>
<paths name="paths"/>
<scripts name="scripts">
Expand Down Expand Up @@ -155,6 +155,7 @@
<script>scripts\handleGameOver.gml</script>
<script>scripts\validateWin.gml</script>
<script>scripts\findPlayer.gml</script>
<script>scripts\lookAtPlayer.gml</script>
</scripts>
<objects name="objects">
<objects name="Enemies">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<For3D>0</For3D>
<width>512</width>
<height>224</height>
<data>images\sky2.png</data>
<data>images\bkgSky1.png</data>
</background>
19 changes: 19 additions & 0 deletions src/background/bkgSky2.background.gmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<background>
<istileset>0</istileset>
<tilewidth>16</tilewidth>
<tileheight>16</tileheight>
<tilexoff>0</tilexoff>
<tileyoff>0</tileyoff>
<tilehsep>0</tilehsep>
<tilevsep>0</tilevsep>
<HTile>-1</HTile>
<VTile>-1</VTile>
<TextureGroups>
<TextureGroup0>4</TextureGroup0>
</TextureGroups>
<For3D>0</For3D>
<width>512</width>
<height>224</height>
<data>images\bkgSky2.png</data>
</background>
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<For3D>0</For3D>
<width>256</width>
<height>224</height>
<data>images\sky3.png</data>
<data>images\bkgSky3.png</data>
</background>
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
<For3D>0</For3D>
<width>256</width>
<height>224</height>
<data>images\weaponSelect.png</data>
<data>images\bkgWeaponSelect.png</data>
</background>
Binary file added src/background/images/bkgSky1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/background/images/bkgSky2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/background/images/bkgSky3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/background/images/bkgWeaponSelect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/background/tileset0.background.gmx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--This Document is generated by GameMaker, if you edit it by hand then you do so at your own risk!-->
<background>
<istileset>-1</istileset>
<istileset>0</istileset>
<tilewidth>16</tilewidth>
<tileheight>16</tileheight>
<tilexoff>0</tilexoff>
Expand Down
32 changes: 7 additions & 25 deletions src/objects/objBean.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -83,27 +83,7 @@ image_speed = 0.24 * objMain.deltaTime;
<argument>
<kind>1</kind>
<string>///Determine a target player to look at.
var player1 = findPlayer(objPlayer1);

if (instance_exists(objPlayer2))
{
var player2 = findPlayer(objPlayer2);

switch(irandom(objMain.currPlayers))
{
default:
case 1:
target = player1;
break;
case 2:
target = player2;
break;
}
}
else
{
target = player1;
}
lookAtPlayer();
</string>
</argument>
</arguments>
Expand Down Expand Up @@ -163,12 +143,14 @@ if (global.state != states.startRoom &amp;&amp; !objMain.cleaningRoom &amp;&amp;
<argument>
<kind>1</kind>
<string>///Always look at the player
if (target.dead) //If the player is dead, attempt to look for a different player
{
lookAtPlayer();
}

with (target)
{
if (!dead)
{
other.direction = point_direction(other.x, other.y, x, y);
}
other.direction = point_direction(other.x, other.y, x, y); //Look at our current target
}
</string>
</argument>
Expand Down
33 changes: 8 additions & 25 deletions src/objects/objBoss1.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -65,27 +65,7 @@ myID = 0;
<argument>
<kind>1</kind>
<string>///Determine a target player to look at.
var player1 = findPlayer(objPlayer1);

if (instance_exists(objPlayer2))
{
var player2 = findPlayer(objPlayer2);

switch(irandom(objMain.currPlayers))
{
default:
case 1:
target = player1;
break;
case 2:
target = player2;
break;
}
}
else
{
target = player1;
}
lookAtPlayer();
</string>
</argument>
</arguments>
Expand Down Expand Up @@ -265,12 +245,15 @@ event_inherited();
<argument>
<kind>1</kind>
<string>///Always look at the player

if (target.dead)
{
lookAtPlayer(); //Attempt to find a new player to look at if our current one is dead
}

with (target)
{
if (!dead)
{
other.direction = point_direction(other.x, other.y, x, y);
}
other.direction = point_direction(other.x, other.y, x, y);
}
</string>
</argument>
Expand Down
33 changes: 8 additions & 25 deletions src/objects/objBossBarrier.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -55,27 +55,7 @@ hitTimerSet = 10;
<argument>
<kind>1</kind>
<string>///Determine a target player to look at.
var player1 = findPlayer(objPlayer1);

if (instance_exists(objPlayer2))
{
var player2 = findPlayer(objPlayer2);

switch(irandom(objMain.currPlayers))
{
default:
case 1:
target = player1;
break;
case 2:
target = player2;
break;
}
}
else
{
target = player1;
}
lookAtPlayer();
</string>
</argument>
</arguments>
Expand Down Expand Up @@ -148,12 +128,15 @@ if (!silentKill)
<argument>
<kind>1</kind>
<string>///Always look at the player

if (target.dead)
{
lookAtPlayer(); //Attempt to find a new player to look at if our current one is dead
}

with (target)
{
if (!dead)
{
other.direction = point_direction(other.x, other.y, x, y);
}
other.direction = point_direction(other.x, other.y, x, y);
}
</string>
</argument>
Expand Down
32 changes: 30 additions & 2 deletions src/objects/objBossEye.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,28 @@ active = false;
hitTimer = 0;
hitTimerSet = 10;
groupID = 0;
</string>
</argument>
</arguments>
</action>
<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>///Always look at the player
lookAtPlayer();
</string>
</argument>
</arguments>
Expand Down Expand Up @@ -103,9 +125,15 @@ groupID = 0;
<argument>
<kind>1</kind>
<string>///Always look at the player
if instance_exists(objPlayer)

if (target.dead)
{
lookAtPlayer(); //Attempt to find a new player to look at if our current one is dead
}

with (target)
{
direction = point_direction(x, y, objPlayer.x, objPlayer.y);
other.direction = point_direction(other.x, other.y, x, y);
}
</string>
</argument>
Expand Down
42 changes: 34 additions & 8 deletions src/objects/objCamera.object.gmx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,35 @@ yCutsceneBarPos=-32;
background_x[0] = objCamera.x+objMain.bg0XParallax;
background_x[1] = objCamera.x+objMain.bg1XParallax;
background_x[2] = objCamera.x+objMain.bg2XParallax;
</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>///Move the camera after everything else has moved
if (global.state!=states.startRoom)
{
x += scrollX * objMain.deltaTime;
y += scrollY * objMain.deltaTime;
}

</string>
</argument>
</arguments>
Expand Down Expand Up @@ -188,7 +217,7 @@ if (debug)
<arguments>
<argument>
<kind>1</kind>
<string>///Movement code
<string>///Move the view and sky background

//Every frame, we should check for any level events (bgm changing, map switching, etc)
levelEvents();
Expand All @@ -198,14 +227,10 @@ background_x[0] = objCamera.x+objMain.bg0XParallax;
background_x[1] = objCamera.x+objMain.bg1XParallax;
background_x[2] = objCamera.x+objMain.bg2XParallax;

if (global.state==states.gameMode)
{
x += scrollX;
y += scrollY;
}

view_xview = objCamera.x;
view_yview = objCamera.y;

view_xview = x + scrollX * objMain.deltaTime;
view_yview = y + scrollY * objMain.deltaTime;

objMain.bg0XParallax+=background_hspeed[0];
objMain.bg1XParallax+=background_hspeed[1];
Expand All @@ -214,6 +239,7 @@ objMain.bg2XParallax+=background_hspeed[2];
background_x[0] = x+objMain.bg0XParallax;
background_x[1] = x+objMain.bg1XParallax;
background_x[2] = x+objMain.bg2XParallax;

</string>
</argument>
</arguments>
Expand Down
Loading

0 comments on commit db1282a

Please sign in to comment.