Move files and made loby screen to help transition to shooting gallery.

This commit is contained in:
JoshuaNavarro 2019-07-23 16:15:13 -07:00
parent 1c8d973a14
commit 87f0ddcb2c
23 changed files with 182 additions and 54 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -4,9 +4,12 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMaps;
using Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCProjectiles;
using Revitalize.Framework.Utilities;
using StardewValley;
using StardustCore.Animations;
using AnimatedSprite = StardustCore.Animations.AnimatedSprite;
namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies
{
@ -30,7 +33,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies
}
public SSCE_Target(AnimatedSprite Sprite, int MoveSpeed, int MaxHealth, Vector2 HitBoxDimensions,float Scale,Vector2 Direction,float Speed):base(Sprite,MoveSpeed,MaxHealth,HitBoxDimensions,Scale)
public SSCE_Target(StardustCore.Animations.AnimatedSprite Sprite, int MoveSpeed, int MaxHealth, Vector2 HitBoxDimensions,float Scale,Vector2 Direction,float Speed):base(Sprite,MoveSpeed,MaxHealth,HitBoxDimensions,Scale)
{
this.direction = Direction;
this.speed = Speed;
@ -39,6 +42,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies
public override void die()
{
this.playDeathAnimation();
Game1.soundBank.PlayCue("breakingGlass");
}
public void playDeathAnimation()
@ -71,10 +75,15 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies
/// <param name="other"></param>
public override void onCollision(SSCProjectile other)
{
if (this.targetHit) return;
if (other is SSCProjectiles.SSCProjectile)
{
this.CurrentHealth -= other.damage;
this.die();
if (SeasideScramble.self.currentMap is ShootingGallery)
{
(SeasideScramble.self.currentMap as ShootingGallery).addScore((other.owner as SSCPlayer).playerID, 1);
}
}
}
@ -99,9 +108,9 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies
} },
{"Die",new List<Animation>()
{
new Animation(0,0,16,16,20),
new Animation(16,0,16,16,20),
new Animation(32,0,16,16,20)
new Animation(0,0,16,16,10),
new Animation(16,0,16,16,10),
new Animation(32,0,16,16,10)
}
}

View File

@ -209,6 +209,8 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCGuns
if (this.canShoot())
{
this.shoot(Position, Direction);
StardewValley.Game1.playSound("coin");
//StardewValley.Game1.playSound("Cowboy_gunshot");
}
}
@ -236,6 +238,8 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCGuns
{
this.remainingAmmo = this.maxAmmo;
this.timeRemainingUntilReload = this.reloadSpeed;
//StardewValley.Game1.soundBank.PlayCue("dwop");
StardewValley.Game1.playSound("cowboy_gunload");
if (this.remainingAmmo== this.maxAmmo)
{
this.isReloading = false;

View File

@ -202,6 +202,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus
{
this.setUpForGameplay();
SeasideScramble.self.menuManager.closeAllMenus();
SeasideScramble.self.menuManager.addNewMenu(new Loby(0, 0, SeasideScramble.self.camera.viewport.Width, SeasideScramble.self.camera.viewport.Height));
}
}
@ -449,6 +450,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus
{
this.setUpForGameplay();
SeasideScramble.self.menuManager.closeAllMenus();
SeasideScramble.self.menuManager.addNewMenu(new Loby(0, 0, SeasideScramble.self.camera.viewport.Width, SeasideScramble.self.camera.viewport.Height));
}
}
if (key == Keys.A)
@ -466,19 +468,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus
/// </summary>
private void setUpForGameplay()
{
foreach (SSCPlayer p in SeasideScramble.self.players.Values)
{
p.HUD.displayHUD();
//p.statusEffects.addStatusEffect(SE_Burn.SpawnBurnEffect(new Vector2(p.HUD.xPositionOnScreen,p.HUD.yPositionOnScreen),10*1000,1000,1.00d,1));
}
SeasideScramble.self.entities.addSpawner(new Target_Spawner(new Vector2(SeasideScrambleMap.TileSize*-1, SeasideScrambleMap.TileSize * 4), new Vector2(1, 0), Color.White, true, 1000, 5000, true, 0.25f, 3f, true));
SeasideScramble.self.entities.addSpawner(new Target_Spawner(new Vector2(SeasideScrambleMap.TileSize * 17, SeasideScrambleMap.TileSize * 5), new Vector2(-1, 0), Color.White, true, 1000, 5000, true, 0.25f, 3f, true));
SeasideScramble.self.currentMap.spawnPlayersAtPositions();
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(100, 100), Color.Blue);
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(200, 100), Color.Red);
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(300, 100), Color.Green);
}
/// <summary>

View File

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMaps;
using StardustCore.Animations;
using StardustCore.UIUtilities;
using StardustCore.UIUtilities.SpriteFonts.Components;
@ -30,6 +31,8 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus.HUD
public AnimatedSprite clock;
public TexturedString reloadTime;
public AnimatedSprite targetsHit;
public TexturedString targetsScoreText;
public SSCPlayer Player
@ -72,6 +75,10 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus.HUD
this.clock = new AnimatedSprite("Clock", new Vector2(x + 32, y + 50), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "Clock"), new Animation(0, 0, 11, 10)), Color.White);
this.reloadTime = SeasideScramble.self.gameFont.ParseString("100", new Vector2(100, this.yPositionOnScreen + 50), Color.White, true, 2f);
this.reloadTime.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 50));
this.targetsHit = new AnimatedSprite("Target", new Vector2(x + 32, y + 100), new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("Enemies", "Target"), new Animation(0, 0, 16, 16)), Color.White);
this.targetsScoreText = SeasideScramble.self.gameFont.ParseString("000", new Vector2(100, this.yPositionOnScreen + 110), Color.White, true, 2f);
this.targetsScoreText.setPosition(new Vector2(this.xPositionOnScreen + 100, this.yPositionOnScreen + 110));
}
public override void update(GameTime time)
@ -90,6 +97,12 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus.HUD
this.playerAmmo.setText(this.Player.gun.remainingAmmo.ToString().PadLeft(3, '0'), SeasideScramble.self.gameFont, Color.White);
}
this.reloadTime.setText(((int)this.Player.gun.timeRemainingUntilReload).ToString().PadLeft(4, '0'), SeasideScramble.self.gameFont, Color.White);
if(SeasideScramble.self.currentMap is ShootingGallery)
{
this.targetsScoreText.setText((SeasideScramble.self.currentMap as ShootingGallery).score[this.playerID].ToString(), SeasideScramble.self.gameFont, this.background.color);
}
}
if (this.showFullHeart)
{
@ -151,6 +164,11 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus.HUD
this.clock.draw(b, 6f, 0f);
this.reloadTime.draw(b, new Rectangle(0, 0, 16, 16), 0f);
}
if(SeasideScramble.self.currentMap is ShootingGallery)
{
this.targetsHit.draw(b,4f,0f);
this.targetsScoreText.draw(b, new Rectangle(0, 0, 16, 16), 0f);
}
}
/// <summary>

View File

@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCEnemies.Spawners;
using StardustCore.UIUtilities;
using StardustCore.UIUtilities.MenuComponents;
namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame.SSCMenus
{
public class Loby:IClickableMenuExtended
{
StardustCore.UIUtilities.Texture2DExtended background;
string menuText;
Button shootingGalleryButton;
Button backButton;
public Loby()
{
}
public Loby(int x, int y, int width, int height) : base(x, y, width, height, false)
{
this.background = SeasideScramble.self.textureUtils.getExtendedTexture("SSCMaps", "TitleScreenBackground");
this.menuText = "The Loby"+System.Environment.NewLine+System.Environment.NewLine+"Choose a game mode";
this.shootingGalleryButton = new Button(new Rectangle(100, 300, 64*4, 32*4), SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "ShootingGalleryButton"), new Rectangle(0, 0, 64, 32), 4f);
this.backButton = new Button(new Rectangle(100, 100, 64, 64), SeasideScramble.self.textureUtils.getExtendedTexture("SSCUI", "BackButton"),new Rectangle(0, 0, 16, 16), 4f);
}
public override void receiveLeftClick(int x, int y, bool playSound = true)
{
if (this.shootingGalleryButton.containsPoint(x, y))
{
foreach (SSCPlayer p in SeasideScramble.self.players.Values)
{
p.HUD.displayHUD();
//p.statusEffects.addStatusEffect(SE_Burn.SpawnBurnEffect(new Vector2(p.HUD.xPositionOnScreen,p.HUD.yPositionOnScreen),10*1000,1000,1.00d,1));
}
SeasideScramble.self.entities.addSpawner(new Target_Spawner(new Vector2(SeasideScrambleMap.TileSize * -1, SeasideScrambleMap.TileSize * 4), new Vector2(1, 0), Color.White, true, 1000, 5000, true, 0.25f, 3f, true));
SeasideScramble.self.entities.addSpawner(new Target_Spawner(new Vector2(SeasideScrambleMap.TileSize * 17, SeasideScrambleMap.TileSize * 5), new Vector2(-1, 0), Color.White, true, 1000, 5000, true, 0.25f, 3f, true));
SeasideScramble.self.currentMap.spawnPlayersAtPositions();
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(100, 100), Color.Blue);
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(200, 100), Color.Red);
//SSCEnemies.SSCE_Target.Spawn_SSCE_Target(new Vector2(300, 100), Color.Green);
SeasideScramble.self.menuManager.closeAllMenus();
}
}
public override bool readyToClose()
{
return false;
}
public override void update(GameTime time)
{
}
private void setUpForGameplay()
{
}
public override void draw(SpriteBatch b)
{
//Draw background.
b.Draw(this.background.texture, new Vector2(this.xPositionOnScreen, this.yPositionOnScreen), SeasideScramble.self.camera.getXNARect(), Color.White);
Vector2 offset = StardewValley.Game1.dialogueFont.MeasureString(this.menuText);
b.DrawString(StardewValley.Game1.dialogueFont,this.menuText,new Vector2((this.width / 2) - (offset.X / 2), this.height *.1f), Color.White);
this.shootingGalleryButton.draw(b);
this.backButton.draw(b);
if (SeasideScramble.self.getPlayer(SSCEnums.PlayerID.One) != null)
{
SeasideScramble.self.getPlayer(SSCEnums.PlayerID.One).drawMouse(b);
}
if (SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Two) != null)
{
SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Two).drawMouse(b);
}
if (SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Three) != null)
{
SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Three).drawMouse(b);
}
if (SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Four) != null)
{
SeasideScramble.self.getPlayer(SSCEnums.PlayerID.Four).drawMouse(b);
}
}
}
}

View File

@ -145,7 +145,7 @@ namespace Revitalize.Framework.Minigame.SeasideScrambleMinigame
}
this.mouseSensitivity = new Vector2(3f, 3f);
this.gun = new SSCGuns.SSCGun(new StardustCore.Animations.AnimatedSprite("MyFirstGun", this.position, new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("Guns", "BasicGun"), new Animation(0, 0, 16, 16)), Color.White), SeasideScramble.self.entities.projectiles.getDefaultProjectile(this, this.position, Vector2.Zero, 1f, new Rectangle(0, 0, 16, 16), Color.White, 4f, 300), 10, 1000, 3000);
this.gun = new SSCGuns.SSCGun(new StardustCore.Animations.AnimatedSprite("MyFirstGun", this.position, new AnimationManager(SeasideScramble.self.textureUtils.getExtendedTexture("Guns", "BasicGun"), new Animation(0, 0, 16, 16)), Color.White), SeasideScramble.self.entities.projectiles.getDefaultProjectile(this, this.position, Vector2.Zero, 4f, new Rectangle(0, 0, 16, 16), Color.White, 4f, 300), 10, 1000, 3000);
this.hitBox = new Rectangle((int)this.position.X, (int)this.position.Y, 64, 64);

View File

@ -85,6 +85,7 @@
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMaps\ShootingGallery.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMenus\CharacterSelectScreen.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMenus\HUD\CharacterHUD.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMenus\Loby.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMenus\SSCMenuManager.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCMenus\TitleScreen.cs" />
<Compile Include="Framework\Minigame\SeasideScrambleMinigame\SSCPlayer.cs" />
@ -166,42 +167,27 @@
<Content Include="Content\Minigames\SeasideScramble\Graphics\Projectiles\Basic.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\0.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\3.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\4.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\5.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\6.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\7.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\8.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\9.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\AButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\BlankTexture.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\AButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\BackButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\lastPageButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\MouseClick.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\nextPageButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Buttons\ShootingGalleryButton.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Clock.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
@ -214,13 +200,34 @@
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Heart.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\lastPageButton.png">
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\0.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\MouseClick.png">
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\1.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\nextPageButton.png">
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\2.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\3.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\4.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\5.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\6.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\7.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\8.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\Numbers\9.png">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Content\Minigames\SeasideScramble\Graphics\UI\StatusEffects\Burn.png">