diff --git a/README.md b/README.md index 9433d31..9f10b3d 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 diff --git a/src/ShmupProj.project.gmx b/src/ShmupProj.project.gmx index 869ad2e..386e2ac 100644 --- a/src/ShmupProj.project.gmx +++ b/src/ShmupProj.project.gmx @@ -44,10 +44,10 @@ - sound\BGM00 - sound\BGM01 - sound\BGM02 - sound\BGM03 + sound\musBoss1 + sound\musFlight2 + sound\musItemEquip + sound\musStage1 sound\itsjoke @@ -102,7 +102,7 @@ sprites\sprTwinLaser sprites\sprForceField - sprites\spr_crosshair + sprites\sprCrosshair sprites\spr16x16 sprites\sprCapsule sprites\sprCursor @@ -114,10 +114,10 @@ background\tileset0 - background\sky1 - background\sky2 - background\sky3 - background\weaponSelect + background\bkgSky1 + background\bkgSky2 + background\bkgSky3 + background\bkgWeaponSelect @@ -155,6 +155,7 @@ + diff --git a/src/background/sky2.background.gmx b/src/background/bkgSky1.background.gmx similarity index 93% rename from src/background/sky2.background.gmx rename to src/background/bkgSky1.background.gmx index 4c7a697..08b155d 100644 --- a/src/background/sky2.background.gmx +++ b/src/background/bkgSky1.background.gmx @@ -15,5 +15,5 @@ 0 512 224 - images\sky2.png + images\bkgSky1.png diff --git a/src/background/bkgSky2.background.gmx b/src/background/bkgSky2.background.gmx new file mode 100644 index 0000000..94fb1a3 --- /dev/null +++ b/src/background/bkgSky2.background.gmx @@ -0,0 +1,19 @@ + + + 0 + 16 + 16 + 0 + 0 + 0 + 0 + -1 + -1 + + 4 + + 0 + 512 + 224 + images\bkgSky2.png + diff --git a/src/background/sky3.background.gmx b/src/background/bkgSky3.background.gmx similarity index 93% rename from src/background/sky3.background.gmx rename to src/background/bkgSky3.background.gmx index 87681dc..ca41248 100644 --- a/src/background/sky3.background.gmx +++ b/src/background/bkgSky3.background.gmx @@ -15,5 +15,5 @@ 0 256 224 - images\sky3.png + images\bkgSky3.png diff --git a/src/background/weaponSelect.background.gmx b/src/background/bkgWeaponSelect.background.gmx similarity index 92% rename from src/background/weaponSelect.background.gmx rename to src/background/bkgWeaponSelect.background.gmx index 930711d..7aa7df1 100644 --- a/src/background/weaponSelect.background.gmx +++ b/src/background/bkgWeaponSelect.background.gmx @@ -15,5 +15,5 @@ 0 256 224 - images\weaponSelect.png + images\bkgWeaponSelect.png diff --git a/src/background/images/bkgSky1.png b/src/background/images/bkgSky1.png new file mode 100644 index 0000000..d331f5d Binary files /dev/null and b/src/background/images/bkgSky1.png differ diff --git a/src/background/images/bkgSky2.png b/src/background/images/bkgSky2.png new file mode 100644 index 0000000..fc814cd Binary files /dev/null and b/src/background/images/bkgSky2.png differ diff --git a/src/background/images/bkgSky3.png b/src/background/images/bkgSky3.png new file mode 100644 index 0000000..f443960 Binary files /dev/null and b/src/background/images/bkgSky3.png differ diff --git a/src/background/images/bkgWeaponSelect.png b/src/background/images/bkgWeaponSelect.png new file mode 100644 index 0000000..8497457 Binary files /dev/null and b/src/background/images/bkgWeaponSelect.png differ diff --git a/src/background/tileset0.background.gmx b/src/background/tileset0.background.gmx index 6b12ba8..37e2dd0 100644 --- a/src/background/tileset0.background.gmx +++ b/src/background/tileset0.background.gmx @@ -1,6 +1,6 @@ - -1 + 0 16 16 0 diff --git a/src/objects/objBean.object.gmx b/src/objects/objBean.object.gmx index 3f0e697..59cd6f6 100644 --- a/src/objects/objBean.object.gmx +++ b/src/objects/objBean.object.gmx @@ -83,27 +83,7 @@ image_speed = 0.24 * objMain.deltaTime; 1 ///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(); @@ -163,12 +143,14 @@ if (global.state != states.startRoom && !objMain.cleaningRoom && 1 ///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 } diff --git a/src/objects/objBoss1.object.gmx b/src/objects/objBoss1.object.gmx index e6a5bd3..001c268 100644 --- a/src/objects/objBoss1.object.gmx +++ b/src/objects/objBoss1.object.gmx @@ -65,27 +65,7 @@ myID = 0; 1 ///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(); @@ -265,12 +245,15 @@ event_inherited(); 1 ///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); } diff --git a/src/objects/objBossBarrier.object.gmx b/src/objects/objBossBarrier.object.gmx index 1586e8a..66ca5af 100644 --- a/src/objects/objBossBarrier.object.gmx +++ b/src/objects/objBossBarrier.object.gmx @@ -55,27 +55,7 @@ hitTimerSet = 10; 1 ///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(); @@ -148,12 +128,15 @@ if (!silentKill) 1 ///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); } diff --git a/src/objects/objBossEye.object.gmx b/src/objects/objBossEye.object.gmx index 917b51f..e0928f8 100644 --- a/src/objects/objBossEye.object.gmx +++ b/src/objects/objBossEye.object.gmx @@ -36,6 +36,28 @@ active = false; hitTimer = 0; hitTimerSet = 10; groupID = 0; + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Always look at the player +lookAtPlayer(); @@ -103,9 +125,15 @@ groupID = 0; 1 ///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); } diff --git a/src/objects/objCamera.object.gmx b/src/objects/objCamera.object.gmx index aa52e3e..43ac1b7 100644 --- a/src/objects/objCamera.object.gmx +++ b/src/objects/objCamera.object.gmx @@ -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; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Move the camera after everything else has moved +if (global.state!=states.startRoom) +{ + x += scrollX * objMain.deltaTime; + y += scrollY * objMain.deltaTime; +} + @@ -188,7 +217,7 @@ if (debug) 1 - ///Movement code + ///Move the view and sky background //Every frame, we should check for any level events (bgm changing, map switching, etc) levelEvents(); @@ -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]; @@ -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; + diff --git a/src/objects/objEnemyParent.object.gmx b/src/objects/objEnemyParent.object.gmx index d3ad0d8..30904fa 100644 --- a/src/objects/objEnemyParent.object.gmx +++ b/src/objects/objEnemyParent.object.gmx @@ -26,27 +26,7 @@ 1 ///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 0: - target = player1; - break; - case 1: - target = player2; - break; - } -} -else -{ - target = player1; -} +lookAtPlayer(); @@ -218,12 +198,14 @@ else 1 ///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); } diff --git a/src/objects/objLion.object.gmx b/src/objects/objLion.object.gmx index 056b2a2..ce61073 100644 --- a/src/objects/objLion.object.gmx +++ b/src/objects/objLion.object.gmx @@ -72,27 +72,7 @@ else{isRed=false;} 1 ///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(); @@ -151,12 +131,15 @@ if (global.state != states.startRoom && !objMain.cleaningRoom && 1 ///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); } @@ -242,17 +225,14 @@ image_index = (imgIndex-1); ///Handle movement if (active) { - if (instance_exists(objPlayer)) + if (!target.dead) { - if (!objPlayer.dead) + if distance_to_point(target.x, target.y) > 0 { - if distance_to_point(objPlayer.x, objPlayer.y) > 0 - { - move_towards_point(objPlayer.x,objPlayer.y, 1.5*objMain.deltaTime); - } + move_towards_point(target.x,target.y, 1.5*objMain.deltaTime); } } - + //Shoot bullets at the player, at a random rate if objMain.loopCounter>1 { diff --git a/src/objects/objMain.object.gmx b/src/objects/objMain.object.gmx index ab2913d..230b44b 100644 --- a/src/objects/objMain.object.gmx +++ b/src/objects/objMain.object.gmx @@ -81,7 +81,7 @@ threshold = 0.8; //Stick sensitvity waitTime=300; //Timer for displaying the credits as the game boots up. //Recommended to set to approximately 300 for public builds -debugEnabled = true; +debugEnabled = false; deltaTime = 1; //Whenever paused, this is set to 0, and 1 when unpaused! //Try multiplying things with this to account for pausing state! @@ -225,6 +225,16 @@ else global.keyAction2 = ord('X'); global.keyAction3 = ord('C'); global.keyPause = vk_enter; + + global.keyP2Up = ord('W'); + global.keyP2Down = ord('S'); + global.keyP2Left = ord('A') + global.keyP2Right = ord('D') + global.keyP2Action1 = ord('J') + global.keyP2Action2 = ord('K') + global.keyP2Action3 = ord('L'); + global.keyP2Pause = ord('H'); + global.grVOptEnabled = false; global.frModeEnabled = false; windowSize = 2; @@ -781,10 +791,6 @@ switch(global.state) //Game mode handling global.statePrevious=global.state; global.state=5; global.pauseTimer=10; - objCamera.scrollXPrevious=objCamera.scrollX; - objCamera.scrollYPrevious=objCamera.scrollY; - objCamera.scrollX=0; - objCamera.scrollY=0; //Freeze the parallax night sky background_hspeed[0] = 0; @@ -821,9 +827,7 @@ switch(global.state) //Game mode handling audio_resume_sound(global.currentSong); global.state=global.statePrevious; global.statePrevious=5; - global.pauseTimer=10; - objCamera.scrollX = objCamera.scrollXPrevious; - objCamera.scrollY = objCamera.scrollYPrevious; + global.pauseTimer=10; //Unfreeze the parallax night sky background_hspeed[0] = -0.2; background_hspeed[1] = -0.4; @@ -951,12 +955,12 @@ else 1 - ///Handle item equip screen + ///Handle the item equip screen if (global.state==states.equipScreen) { - if !audio_is_playing(BGM03) + if !audio_is_playing(musItemEquip) { - changeBGM(BGM03,true); + changeBGM(musItemEquip,true); } //Get input @@ -967,7 +971,6 @@ if (global.state==states.equipScreen) var keyDown = keyP1DownPressed; var moveY = keyUp+keyDown; - var p2KeyLeft = -keyP2LeftPressed; var p2KeyRight = keyP2RightPressed; var p2MoveX = p2KeyLeft+p2KeyRight; @@ -987,7 +990,17 @@ if (global.state==states.equipScreen) if (equipChangeTimer==1 || equipBackTimer==1) { if (menuProgressedLast==1){shieldSelect++;} - if (menuProgressedLast==2){shieldSelect--;} + if (menuProgressedLast==2) + { + if (!global.frModeEnabled) + { + shieldSelect--; + } + else + { + shieldSelect-=2; + } + } menuProgressedLast = 0; equipChangeTimer=0; equipBackTimer=0; @@ -995,7 +1008,17 @@ if (global.state==states.equipScreen) if (p2EquipChangeTimer==1 || p2EquipBackTimer==1) { if (p2MenuProgressedLast==1){p2ShieldSelect++;} - if (p2MenuProgressedLast==2){p2ShieldSelect--;} + if (p2MenuProgressedLast==2) + { + if (!global.frModeEnabled) + { + p2ShieldSelect--; + } + else + { + p2ShieldSelect-=2; + } + } p2MenuProgressedLast = 0; p2EquipChangeTimer=0; p2EquipBackTimer=0; @@ -1022,7 +1045,7 @@ if (global.state==states.equipScreen) //Move around the menu if we press Cancel, but add a delay between presses. if (keyP1Action1Pressed && shieldSelect>0 && equipBackTimer<=0 && equipChangeTimer<=0) { - if (p2ShieldSelect<=1 && objMain.currPlayers>1) + if ((p2ShieldSelect<=1 && objMain.currPlayers>1) || (objMain.currPlayers<=1 && shieldSelect<=1)) //Only allow menu cancelling if Player 2 isn't finished with weapon configuration, or if we're on single player and just finished weapon configuration. { audio_stop_sound(sfxMenuCancel); audio_play_sound(sfxMenuCancel,0,false); @@ -1230,7 +1253,7 @@ if (global.state==states.equipScreen) loadLevel("map00.oel"); global.prevMap = "map00.oel"; audio_stop_sound(global.currentSong); - changeBGM(BGM00,false); + changeBGM(musFlight2,false); objMain.x = objCamera.x; objMain.y = objCamera.y; global.state = states.startRoom; @@ -1331,30 +1354,30 @@ show_debug_message("Pad = " + string(async_load[? "pad_index"])); // triggered switch(async_load[? "event_type"]) // Parse the async_load map to see which event has been triggered { -case "gamepad discovered": // A game pad has been discovered - var pad = async_load[? "pad_index"]; // Get the pad index value from the async_load map - if (p1HasController <= 0) - { - p1HasController = pad; - } - else if (p2HasController <= 0) - { - p2HasController = pad; - } - //gamepad_set_axis_deadzone(pad, 0.5); // Set the "deadzone" for the axis - //gamepad_set_button_threshold(pad, 0.1); // Set the "threshold" for the triggers - break; -case "gamepad lost": // Gamepad has been removed or otherwise disabled - var pad = async_load[? "pad_index"]; // Get the pad index - if (p1HasController == pad) - { - p1HasController = 0; - } - else if (p2HasController == pad) - { - p2HasController = 0; - } - break; + case "gamepad discovered": // A game pad has been discovered + var pad = async_load[? "pad_index"]; // Get the pad index value from the async_load map + if (p1HasController <= 0) + { + p1HasController = pad; + } + else if (p2HasController <= 0) + { + p2HasController = pad; + } + //gamepad_set_axis_deadzone(pad, 0.5); // Set the "deadzone" for the axis + //gamepad_set_button_threshold(pad, 0.1); // Set the "threshold" for the triggers + break; + case "gamepad lost": // Gamepad has been removed or otherwise disabled + var pad = async_load[? "pad_index"]; // Get the pad index + if (p1HasController == pad) + { + p1HasController = 0; + } + else if (p2HasController == pad) + { + p2HasController = 0; + } + break; } @@ -1388,14 +1411,14 @@ if (global.state==states.equipScreen) draw_set_color(c_black); draw_rectangle(-32,-32,500,500,false); - draw_background(weaponSelect,0,0); + draw_background(bkgWeaponSelect,0,0); draw_enable_alphablend(true); //Player 1 if (equipChangeTimer%5==0) { - equipTypeBlinkShow = !equipTypeBlinkShow; - equipShieldBlinkShow = !equipShieldBlinkShow; + equipTypeBlinkShow = !equipTypeBlinkShow; + equipShieldBlinkShow = !equipShieldBlinkShow; } if (global.tick%90==0) @@ -1447,12 +1470,6 @@ if (global.state==states.equipScreen) draw_rectangle(155+(equipShieldPos*48),215,180+(equipShieldPos*48),215,false); //Lower } - if (global.frModeEnabled && frModeFlicker) - { - draw_set_color(c_yellow); - draw_text(0,8*28,"Friendly Mode: Auto-Force Field"); - } - if (equipTypePos==p2EquipTypePos && currPlayers>1) { draw_set_color($88E0A0); @@ -1602,18 +1619,18 @@ if !instance_exists(objCamera) 1 - ///Handle Intro and set font + ///Handle game bootup text and set a global (sprite-based) font draw_enable_alphablend(false); if global.tick==5||global.tick==6 { -draw_set_color(c_white); -draw_rectangle(-8,128,290,140,false); + draw_set_color(c_white); + draw_rectangle(-8,128,290,140,false); } else if global.tick==8||global.tick==9 { -draw_set_color(c_gray); -draw_rectangle(-8,40,290,42,false); + draw_set_color(c_gray); + draw_rectangle(-8,40,290,42,false); } draw_set_font(global.font); @@ -1622,7 +1639,7 @@ if global.tick<=waitTime+10 { draw_set_color(c_white); draw_set_alpha(1); - draw_text(8*5,8*12," Gradius Engine# v1.4## by## mysterypaint#"); + draw_text(8*5,8*12," Gradius Engine# v1.5 Preview## by## mysterypaint#"); } //Fade out on top of the text @@ -1636,13 +1653,13 @@ if global.tick<=15 || (global.tick >waitTime+5 && global.tick < } else if (global.tick>15 && global.tick<=20) || (global.tick>waitTime && global.tick<=waitTime+5) { -draw_set_alpha(0.4); -draw_rectangle(-1,16,257,257,false); + draw_set_alpha(0.4); + draw_rectangle(-1,16,257,257,false); } else if global.tick>20 && global.tick<=waitTime { -draw_set_alpha(0); -draw_rectangle(-1,16,257,257,false); + draw_set_alpha(0); + draw_rectangle(-1,16,257,257,false); } diff --git a/src/objects/objPlayer.object.gmx b/src/objects/objPlayer.object.gmx index 1f6a0bc..b51237e 100644 --- a/src/objects/objPlayer.object.gmx +++ b/src/objects/objPlayer.object.gmx @@ -27,20 +27,35 @@ 1 ///Code optimization attempt for in-game gameplay //You can read more about this here: http://www.yoyogames.com/blog/23 - draw_texture_flush(); draw_sprite(sprPlayer, 0, 0, 0); draw_sprite(sprPlayerHitbox, 0, 0, 0); draw_sprite(sprPlayerCapsuleHitbox, 0, 0, 0); +draw_sprite(sprPlayer2, 0, 0, 0); draw_sprite(sprOption, 0, 0, 0); draw_sprite(sprLaser, 0, 0, 0); draw_sprite(sprFrontShield, 0, 0, 0); +draw_sprite(sprForceField, 0, 0, 0); draw_sprite(sprFont, 0, 0, 0); draw_sprite(sprDouble, 0, 0, 0); draw_sprite(sprBullet, 0, 0, 0); draw_sprite(tileset0, 0, 0, 0); draw_sprite(sprSpreadExplosion, 0, 0, 0); +draw_sprite(sprTwinLaser, 0, 0, 0); +draw_sprite(sprRippleLaser, 0, 0, 0); draw_sprite(sprCapsule, 0, 0, 0); +draw_sprite(sprPowerupHUD, 0, 0, 0); +draw_sprite(sprFont, 0, 0, 0); + + +draw_sprite(spr16x16Explosion, 0, 0, 0); +draw_sprite(sprBean, 0, 0, 0); +draw_sprite(sprBossEye, 0, 0, 0); +draw_sprite(sprBossLaser, 0, 0, 0); +draw_sprite(sprDee01, 0, 0, 0); +draw_sprite(sprEnemyBullet, 0, 0, 0); +draw_sprite(sprLion, 0, 0, 0); +draw_sprite(sprBossBarrier, 0, 0, 0); diff --git a/src/objects/objPlayer1.object.gmx b/src/objects/objPlayer1.object.gmx index 81bd255..264c52e 100644 --- a/src/objects/objPlayer1.object.gmx +++ b/src/objects/objPlayer1.object.gmx @@ -66,6 +66,7 @@ if (flyingIn>=0) if (!explode) { + if (objMain.currPlayers<=1){audio_stop_all();} audio_stop_sound(sfxDie); audio_play_sound(sfxDie,0,false); deadTimer = 4*deadTimerMult+deadWaitTime; @@ -81,6 +82,7 @@ if (flyingIn>=0) { if (objPlayer2.dead) { + audio_stop_all(); resetRoom(); //Reset the room to how it originally was (the player still remembers how far they got in the level though) global.state = states.startRoom; objMain.startRoomTimer = objMain.startRoomTimerLength; @@ -113,14 +115,7 @@ if (flyingIn>=0) } } //Timer hit zero. Now, we switch back to the START screen. } - //Account for camera scrolling before we move the player at all - //Player and capsule-grabbing hitbox will keep scrolling with the camera even if they're dead - - if global.state != states.startRoom - { - x+=objCamera.scrollX; - y+=objCamera.scrollY; - } + if (!dead && (global.state == states.gameMode || global.state == states.cutscene)) //Check if the player is still alive { @@ -226,8 +221,8 @@ if (flyingIn>=0) } vsp = 0; } - x += hsp; - y += vsp; + x += hsp * objMain.deltaTime; + y += vsp * objMain.deltaTime; } } else @@ -241,6 +236,15 @@ else movingHoriz=0; } } + +//Account for camera scrolling +//Player and capsule-grabbing hitbox will keep scrolling with the camera even if they're dead + +if global.state != states.startRoom +{ + x += objCamera.scrollX * objMain.deltaTime; + y += objCamera.scrollY * objMain.deltaTime; +} diff --git a/src/objects/objPlayer2.object.gmx b/src/objects/objPlayer2.object.gmx index bcc61ed..0a3c8d0 100644 --- a/src/objects/objPlayer2.object.gmx +++ b/src/objects/objPlayer2.object.gmx @@ -171,14 +171,7 @@ if (flyingIn>=0) } } } - //Account for camera scrolling before we move the player at all - //Player and capsule-grabbing hitbox will keep scrolling with the camera even if they're dead - - if global.state != states.startRoom - { - x+=objCamera.scrollX; - y+=objCamera.scrollY; - } + if (!dead && (global.state == states.gameMode || global.state == states.cutscene)) //Check if the player is still alive { @@ -223,8 +216,8 @@ if (flyingIn>=0) } halveMovement=1; - hsp = playerSpeed*movingHoriz/halveMovement; - vsp = -(playerSpeed*movingVert/halveMovement); + hsp = playerSpeed*movingHoriz/halveMovement * objMain.deltaTime;; + vsp = -(playerSpeed*movingVert/halveMovement) * objMain.deltaTime;; //Kill if the player hits a wall or enemy bullet within the level @@ -299,6 +292,15 @@ else movingHoriz=0; } } + +//Account for camera scrolling +//Player and capsule-grabbing hitbox will keep scrolling with the camera even if they're dead + +if global.state != states.startRoom +{ + x += objCamera.scrollX * objMain.deltaTime; + y += objCamera.scrollY * objMain.deltaTime; +} @@ -528,11 +530,11 @@ if (flyingIn>=0) //The HUD itself is drawn in objCamera's Draw Event if (flyingIn>=0) { - if (objMain.shieldType==0 && instance_number(objFrontShield)<=0) + if (objMain.p2ShieldType==0 && instance_number(objFrontShield)<=0) { hasQuestion = false; } - else if (objMain.shieldType==1 && HP <= 1) + else if (objMain.p2ShieldType==1 && HP <= 1) { hasQuestion = false; } diff --git a/src/objects/objTitle.object.gmx b/src/objects/objTitle.object.gmx index 6fa6c97..835f46f 100644 --- a/src/objects/objTitle.object.gmx +++ b/src/objects/objTitle.object.gmx @@ -33,11 +33,11 @@ draw_sprite(sprFont, 0, 0, 0); draw_sprite(sprCursor, 0, 0, 0); draw_sprite(sprTitleLogo, 0, 0, 0); draw_sprite(sprStart, 0, 0, 0); -draw_sprite(sky1, 0, 0, 0); -draw_sprite(sky2, 0, 0, 0); -draw_sprite(sky3, 0, 0, 0); +draw_sprite(bkgSky1, 0, 0, 0); +draw_sprite(bkgSky2, 0, 0, 0); +draw_sprite(bkgSky3, 0, 0, 0); draw_sprite(sprEquipHighlight, 0, 0, 0); -draw_sprite(weaponSelect, 0, 0, 0); +draw_sprite(bkgWeaponSelect, 0, 0, 0); @@ -114,6 +114,74 @@ prevKeyP2Pause = global.keyP2Pause; moveYPressed=0; holdYTimer=20; + +startP1Blink = true; +startP2Blink = true; + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Start co-op mode (timer is set in the menuExecute() script) +//Jump to the equip screen state +//objMain's Step Event and Draw Event control the entire state +global.state = states.equipScreen; +objMain.shieldSelect = 0; +objMain.menuProgressedLast = 0; +objMain.p2ShieldSelect = 0; +objMain.p2MenuProgressedLast = 0; +objMain.currPlayers = 2; +global.playerLives = 5; +instance_destroy(); + + + + + + + + 1 + 603 + 7 + 0 + 0 + -1 + 2 + + + self + 0 + 0 + + + 1 + ///Start one-player mode (timer is set in the menuExecute() script) +//Jump to the equip screen state +//objMain's Step Event and Draw Event control the entire state +global.state = states.equipScreen; +objMain.shieldSelect = 0; +objMain.menuProgressedLast = 0; +objMain.p2ShieldSelect = 0; +objMain.p2MenuProgressedLast = 0; +objMain.currPlayers = 1; +instance_destroy(); @@ -215,6 +283,10 @@ moveX += max(keyboard_check(ord('D')),keyboard_check(vk_right),0); moveXPressed -= max(keyboard_check_pressed(ord('A')),keyboard_check_pressed(vk_left),0); moveXPressed += max(keyboard_check_pressed(ord('D')),keyboard_check_pressed(vk_right),0); +//Prevent all movement if the menuExecute() script has already set the timer to start a 1P or Co-Op game. +if (alarm[0]>0) {moveX=0; moveY=0; pushConfirm = 0; pushCancel=0;} +if (alarm[1]>0) {moveX=0; moveY=0; pushConfirm = 0; pushCancel=0;} + if currentMenu!=0 && currentMenu!=3 { if moveY!=0 @@ -533,14 +605,16 @@ holdYTimer--; 1 - ///Draw the title + ///Draw the title menu draw_enable_alphablend(false); draw_sprite(sprTitleLogo, 0, x, y); draw_enable_alphablend(true); draw_set_color($ff33cc); draw_set_alpha(1); -//draw_text(0,0,string(mpos)); + +if (alarm[0]%6==0) {startP1Blink = !startP1Blink;} +if (alarm[1]%6==0) {startP2Blink = !startP2Blink;} if pressStartText==false && currentMenu!=3 { @@ -548,10 +622,14 @@ if pressStartText==false && currentMenu!=3 if currentMenu==1 //Main Menu { - for (m=0; m < array_length_1d(menu); m++;) - { - draw_text(x+space,(y+m*space)+64,string(menu[m])); - } + //Start + if (startP1Blink){draw_text(x+space,(y+0*space)+64,string(menu[0]));} + //Co-Op Start + if (startP2Blink){draw_text(x+space,(y+1*space)+64,string(menu[1]));} + //Options + draw_text(x+space,(y+2*space)+64,string(menu[2])); + //Quit + draw_text(x+space,(y+3*space)+64,string(menu[3])); } if currentMenu==2 //Options Menu { @@ -601,10 +679,11 @@ if pressStartText==false && currentMenu!=3 } + //Highlight the current menu position we're hovered over draw_set_color($83F52C); - if currentMenu==1 draw_text(x+space,(y+mpos*space)+64,string(menu[mpos])); + if (currentMenu==1 && startP1Blink && startP2Blink) draw_text(x+space,(y+mpos*space)+64,string(menu[mpos])); else if currentMenu==2 draw_text(x+space,(y+mpos*space)+64,string(menu2[mpos])); - + //Draw the finger pointing sprite on the menu draw_sprite(sprCursor,0,sineX-14,(y+mpos*space)+64-2); } else if currentMenu==0 diff --git a/src/rooms/room0.room.gmx b/src/rooms/room0.room.gmx index 3b7f31c..11ff4d7 100644 --- a/src/rooms/room0.room.gmx +++ b/src/rooms/room0.room.gmx @@ -41,9 +41,9 @@ 0 - - - + + + diff --git a/src/scripts/changeMap.gml b/src/scripts/changeMap.gml index 4c78cbd..498111a 100644 --- a/src/scripts/changeMap.gml +++ b/src/scripts/changeMap.gml @@ -17,11 +17,11 @@ if (objMain.switchingMaps == false && objMain.bgmFadeoutMultiplier<=0) switch(i) { - case 0: objToFind="objEnemyParent"; break; - case 1: objToFind="objBean"; break; - case 2: objToFind="objLion"; break; - case 3: objToFind="objDee01"; break; - case 4: objToFind="objCapsule"; break; + case 0: objToFind = "objEnemyParent"; break; + case 1: objToFind = "objBean"; break; + case 2: objToFind = "objLion"; break; + case 3: objToFind = "objDee01"; break; + case 4: objToFind = "objCapsule"; break; default: break; } @@ -32,14 +32,13 @@ if (objMain.switchingMaps == false && objMain.bgmFadeoutMultiplier<=0) for (j = 0; j < instance_number(objToFind); j++) { thisEnemy = instance_find(objToFind,j); - thisEnemy.silentKill=true; //... Delete all enemies that are not on the camera if !(thisEnemy.x >= objCamera.x-64 && thisEnemy.x <= objCamera.x+64 + objCamera.viewportWidth && thisEnemy.y >= objCamera.y-64 && thisEnemy.y <= objCamera.y+64 + objCamera.viewportHeight) { - with (thisEnemy){instance_destroy();} + with (thisEnemy){silentKill = true; instance_destroy();} totalDeleteCount++; } else diff --git a/src/scripts/drawForceField.gml b/src/scripts/drawForceField.gml index b56fcb3..24c1e49 100644 --- a/src/scripts/drawForceField.gml +++ b/src/scripts/drawForceField.gml @@ -20,6 +20,6 @@ if (!argument[0].dead) var shieldRatio = ((argument[0].HP-1)/(argument[0].HPMax-1+enlargeShield))/2; //Divide by two because the sprite is twice as large { - draw_sprite_ext(sprForceField,argument[0].forceFrame,argument[0].x+objCamera.scrollX,argument[0].y+objCamera.scrollY,shieldRatio,shieldRatio,0,forceColor,0.45); + draw_sprite_ext(sprForceField,argument[0].forceFrame,argument[0].x+objCamera.scrollX+argument[0].flyingIn,argument[0].y+objCamera.scrollY,shieldRatio,shieldRatio,0,forceColor,0.26); } } diff --git a/src/scripts/handleBGM.gml b/src/scripts/handleBGM.gml index 38415c7..65b5703 100644 --- a/src/scripts/handleBGM.gml +++ b/src/scripts/handleBGM.gml @@ -10,9 +10,9 @@ var sngStrm = objMain.songStream; switch(currSng) { - case BGM00: introLength = 1.311; loopLength = 20.971; songLoops = true; break; - case BGM01: introLength = 6.079; loopLength = 83.986; songLoops = true; break; - case BGM02: introLength = 1.723; loopLength = 13.263; songLoops = true; break; + case musFlight2: introLength = 1.311; loopLength = 20.971; songLoops = true; break; + case musStage1: introLength = 6.079; loopLength = 83.986; songLoops = true; break; + case musBoss1: introLength = 1.723; loopLength = 13.263; songLoops = true; break; case -99: nothing = true; break; default: break; } diff --git a/src/scripts/levelEvents.gml b/src/scripts/levelEvents.gml index bd3dc5d..fb5a3a3 100644 --- a/src/scripts/levelEvents.gml +++ b/src/scripts/levelEvents.gml @@ -7,7 +7,7 @@ switch(global.currentMap) if objCamera.x<-250{objMain.nextGameLoop=false;} if objCamera.x > (global.mapWidth * global.tileWidth) - 32 && !objMain.nextGameLoop { - changeMap("map01.oel",BGM01); + changeMap("map01.oel",musStage1); } break; @@ -17,9 +17,9 @@ switch(global.currentMap) { //... Boss time! objMain.rememberBGM = false; - global.prevSong = BGM01; + global.prevSong = musStage1; audio_stop_sound(global.currentSong); - changeBGM(BGM02,false); //Boss BGM Intro (Loop handled automatically) + changeBGM(musBoss1,false); //Boss BGM Intro (Loop handled automatically) global.prevMap = "map01.oel"; //Just in case we die here global.currentMap = "map01.oel"; //Just in case we die here spawnBoss1(); //Spawn the first boss of the game @@ -34,13 +34,13 @@ switch(global.currentMap) objMain.switchingMaps = false; objMain.bgmFadeoutMultiplier = 0; objMain.showLoop = 182; //For the specified length of frames, tell the player which loop they're on - global.currentSong = BGM00; + global.currentSong = musFlight2; global.prevMap = "map00.oel"; //Set to the same map so we don't accidentally warp back to this map state if we die on the next state objCamera.scrollX = 0.3; objCamera.y = 0; objPlayer1.y = (objPlayer1.y%objCamera.viewportHeight); if instance_exists(objPlayer2){objPlayer2.y = (objPlayer2.y%objCamera.viewportHeight);} - changeMap("map00.oel",BGM00); //Infinite loop, for demonstration purposes + changeMap("map00.oel",musFlight2); //Infinite loop, for demonstration purposes objMain.loopCounter++; //Starting from 1, keeps track of how many times we've reached this point of the game (Could be used as a difficulty determinant) } break; diff --git a/src/scripts/lookAtPlayer.gml b/src/scripts/lookAtPlayer.gml new file mode 100644 index 0000000..03990eb --- /dev/null +++ b/src/scripts/lookAtPlayer.gml @@ -0,0 +1,22 @@ +///This script helps enemy objects determine which player they should be looking at +var player1 = findPlayer(objPlayer1); + +if (instance_exists(objPlayer2)) +{ + var player2 = findPlayer(objPlayer2); + + switch(irandom(objMain.currPlayers)) + { + default: + case 0: + target = player1; + break; + case 1: + target = player2; + break; + } +} +else +{ + target = player1; +} diff --git a/src/scripts/menuExecute.gml b/src/scripts/menuExecute.gml index fba1d5d..a92615b 100644 --- a/src/scripts/menuExecute.gml +++ b/src/scripts/menuExecute.gml @@ -6,28 +6,23 @@ if currentMenu==1 { //Start case 0: - //Jump to the equip screen state - //objMain's Step Event and Draw Event control the entire state - global.state = states.equipScreen; - objMain.shieldSelect = 0; - objMain.menuProgressedLast = 0; - objMain.p2ShieldSelect = 0; - objMain.p2MenuProgressedLast = 0; - objMain.currPlayers = 1; - instance_destroy(); + //Set a timer in objTitle to start single-player mode + if (alarm[0]<=0) + { + audio_stop_sound(sfxMenuAccept); + audio_play_sound(sfxMenuAccept,1,false); + alarm[0] = 100; + } break; //Co-Op Mode (2 Players) case 1: - //Jump to the equip screen state - //objMain's Step Event and Draw Event control the entire state - global.state = states.equipScreen; - objMain.shieldSelect = 0; - objMain.menuProgressedLast = 0; - objMain.p2ShieldSelect = 0; - objMain.p2MenuProgressedLast = 0; - objMain.currPlayers = 2; - global.playerLives = 5; - instance_destroy(); + //Set a timer in objTitle to start co-op mode + if (alarm[1]<=0) + { + audio_stop_sound(sfxMenuAccept); + audio_play_sound(sfxMenuAccept,1,false); + alarm[1] = 100; + } break; //Options case 2: diff --git a/src/scripts/spawnBoss1.gml b/src/scripts/spawnBoss1.gml index eafc73f..218af83 100644 --- a/src/scripts/spawnBoss1.gml +++ b/src/scripts/spawnBoss1.gml @@ -19,7 +19,7 @@ b1.groupID = 1; b2.groupID = 1; b3.groupID = 1; //Finally, give the boss an eye -var myEye = instance_create(x,y,objBossEye); +var myEye = instance_create(objCamera.x+objCamera.viewportWidth+64,128,objBossEye); myEye.image_index = 2; myEye.groupID = 1; //Share a group ID with the barriers (so it can't die unless all the barriers have been destroyed) p1.myEye = myEye; //Let the boss shell know this eye is theirs diff --git a/src/sound/audio/BGM00.wav b/src/sound/audio/BGM00.wav deleted file mode 100644 index 5a19d81..0000000 Binary files a/src/sound/audio/BGM00.wav and /dev/null differ diff --git a/src/sound/audio/BGM00Loop.wav b/src/sound/audio/BGM00Loop.wav deleted file mode 100644 index 5acc81b..0000000 Binary files a/src/sound/audio/BGM00Loop.wav and /dev/null differ diff --git a/src/sound/audio/BGM01.wav b/src/sound/audio/BGM01.wav deleted file mode 100644 index c27660c..0000000 Binary files a/src/sound/audio/BGM01.wav and /dev/null differ diff --git a/src/sound/audio/BGM01Loop.wav b/src/sound/audio/BGM01Loop.wav deleted file mode 100644 index ae54bc8..0000000 Binary files a/src/sound/audio/BGM01Loop.wav and /dev/null differ diff --git a/src/sound/audio/BGM02.wav b/src/sound/audio/BGM02.wav deleted file mode 100644 index b1219a0..0000000 Binary files a/src/sound/audio/BGM02.wav and /dev/null differ diff --git a/src/sound/audio/BGM02Loop.wav b/src/sound/audio/BGM02Loop.wav deleted file mode 100644 index e824bec..0000000 Binary files a/src/sound/audio/BGM02Loop.wav and /dev/null differ diff --git a/src/sound/audio/apollon.ogg b/src/sound/audio/apollon.ogg deleted file mode 100644 index d07c9bd..0000000 Binary files a/src/sound/audio/apollon.ogg and /dev/null differ diff --git a/src/sound/audio/apollon.wav b/src/sound/audio/apollon.wav deleted file mode 100644 index 5a19d81..0000000 Binary files a/src/sound/audio/apollon.wav and /dev/null differ diff --git a/src/sound/audio/apollonIntro.ogg b/src/sound/audio/apollonIntro.ogg deleted file mode 100644 index d07c9bd..0000000 Binary files a/src/sound/audio/apollonIntro.ogg and /dev/null differ diff --git a/src/sound/audio/apollonLoop.ogg b/src/sound/audio/apollonLoop.ogg deleted file mode 100644 index b8169ee..0000000 Binary files a/src/sound/audio/apollonLoop.ogg and /dev/null differ diff --git a/src/sound/audio/apollonLoop.wav b/src/sound/audio/apollonLoop.wav deleted file mode 100644 index 5acc81b..0000000 Binary files a/src/sound/audio/apollonLoop.wav and /dev/null differ diff --git a/src/sound/audio/bgmTitle.mp3 b/src/sound/audio/bgmTitle.mp3 deleted file mode 100644 index 1c5307e..0000000 Binary files a/src/sound/audio/bgmTitle.mp3 and /dev/null differ diff --git a/src/sound/audio/BGM02.ogg b/src/sound/audio/musBoss1.ogg similarity index 100% rename from src/sound/audio/BGM02.ogg rename to src/sound/audio/musBoss1.ogg diff --git a/src/sound/audio/BGM00.ogg b/src/sound/audio/musFlight2.ogg similarity index 100% rename from src/sound/audio/BGM00.ogg rename to src/sound/audio/musFlight2.ogg diff --git a/src/sound/audio/BGM03.ogg b/src/sound/audio/musItemEquip.ogg similarity index 100% rename from src/sound/audio/BGM03.ogg rename to src/sound/audio/musItemEquip.ogg diff --git a/src/sound/audio/BGM01.ogg b/src/sound/audio/musStage1.ogg similarity index 100% rename from src/sound/audio/BGM01.ogg rename to src/sound/audio/musStage1.ogg diff --git a/src/sound/audio/sfxMCrash.wav b/src/sound/audio/sfxMCrash.wav index b6c3c87..0f19ecc 100644 Binary files a/src/sound/audio/sfxMCrash.wav and b/src/sound/audio/sfxMCrash.wav differ diff --git a/src/sound/audio/sound15.wav b/src/sound/audio/sound15.wav deleted file mode 100644 index b6c3c87..0000000 Binary files a/src/sound/audio/sound15.wav and /dev/null differ diff --git a/src/sound/musBoss1.sound.gmx b/src/sound/musBoss1.sound.gmx new file mode 100644 index 0000000..6897f1e --- /dev/null +++ b/src/sound/musBoss1.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musBoss1.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 0 + + + 16 + + -1 + musBoss1.ogg + 1 + 1 + 0 + 0 + diff --git a/src/sound/musFlight2.sound.gmx b/src/sound/musFlight2.sound.gmx new file mode 100644 index 0000000..0331ddc --- /dev/null +++ b/src/sound/musFlight2.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musFlight2.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 0 + + + 16 + + -1 + musFlight2.ogg + 1 + 1 + 0 + 0 + diff --git a/src/sound/musItemEquip.sound.gmx b/src/sound/musItemEquip.sound.gmx new file mode 100644 index 0000000..f2aacc4 --- /dev/null +++ b/src/sound/musItemEquip.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musItemEquip.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 0 + + + 16 + + -1 + musItemEquip.ogg + 1 + 1 + 0 + 0 + diff --git a/src/sound/musStage1.sound.gmx b/src/sound/musStage1.sound.gmx new file mode 100644 index 0000000..60759af --- /dev/null +++ b/src/sound/musStage1.sound.gmx @@ -0,0 +1,29 @@ + + + 3 + .ogg + sound\audio\musStage1.ogg + 0 + + 1 + + 0 + + 192 + + + 44100 + + + 0 + + + 16 + + -1 + musStage1.ogg + 1 + 1 + 0 + 0 + diff --git a/src/sprites/images/sprCrosshair_0.png b/src/sprites/images/sprCrosshair_0.png new file mode 100644 index 0000000..2fd6ef6 Binary files /dev/null and b/src/sprites/images/sprCrosshair_0.png differ diff --git a/src/sprites/spr_crosshair.sprite.gmx b/src/sprites/sprCrosshair.sprite.gmx similarity index 91% rename from src/sprites/spr_crosshair.sprite.gmx rename to src/sprites/sprCrosshair.sprite.gmx index 56c3177..5123ace 100644 --- a/src/sprites/spr_crosshair.sprite.gmx +++ b/src/sprites/sprCrosshair.sprite.gmx @@ -20,6 +20,6 @@ 16 16 - images\spr_crosshair_0.png + images\sprCrosshair_0.png