Structure
This commit is contained in:
parent
c0acfb2266
commit
ec25bf6c03
46 changed files with 467 additions and 44 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
12
MonogameLabel/Class1.cs
Normal file
12
MonogameLabel/Class1.cs
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
using System;
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
|
||||||
|
using MonogameLabel.Enums;
|
||||||
|
|
||||||
|
namespace MonogameLabel
|
||||||
|
{
|
||||||
|
public class Label
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
7
MonogameLabel/MonogameLabel.csproj
Normal file
7
MonogameLabel/MonogameLabel.csproj
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
|
@ -0,0 +1,4 @@
|
||||||
|
// <autogenerated />
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v3.1", FrameworkDisplayName = "")]
|
|
@ -0,0 +1,23 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <auto-generated>
|
||||||
|
// Этот код создан программой.
|
||||||
|
// Исполняемая версия:4.0.30319.42000
|
||||||
|
//
|
||||||
|
// Изменения в этом файле могут привести к неправильной работе и будут потеряны в случае
|
||||||
|
// повторной генерации кода.
|
||||||
|
// </auto-generated>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
|
[assembly: System.Reflection.AssemblyCompanyAttribute("MonogameLabel")]
|
||||||
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||||
|
[assembly: System.Reflection.AssemblyProductAttribute("MonogameLabel")]
|
||||||
|
[assembly: System.Reflection.AssemblyTitleAttribute("MonogameLabel")]
|
||||||
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|
||||||
|
// Создано классом WriteCodeFragment MSBuild.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
f3488a544923f5cf4ff627a8dd1187148f38bf5b
|
|
@ -0,0 +1,3 @@
|
||||||
|
is_global = true
|
||||||
|
build_property.RootNamespace = MonogameLabel
|
||||||
|
build_property.ProjectDir = C:\Users\Semejkin_AV\Desktop\Pacman_refactored\MonogameLabel\
|
BIN
MonogameLabel/obj/Debug/netcoreapp3.1/MonogameLabel.assets.cache
Normal file
BIN
MonogameLabel/obj/Debug/netcoreapp3.1/MonogameLabel.assets.cache
Normal file
Binary file not shown.
Binary file not shown.
68
MonogameLabel/obj/MonogameLabel.csproj.nuget.dgspec.json
Normal file
68
MonogameLabel/obj/MonogameLabel.csproj.nuget.dgspec.json
Normal file
|
@ -0,0 +1,68 @@
|
||||||
|
{
|
||||||
|
"format": 1,
|
||||||
|
"restore": {
|
||||||
|
"C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj": {}
|
||||||
|
},
|
||||||
|
"projects": {
|
||||||
|
"C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"restore": {
|
||||||
|
"projectUniqueName": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj",
|
||||||
|
"projectName": "MonogameLabel",
|
||||||
|
"projectPath": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj",
|
||||||
|
"packagesPath": "C:\\Users\\Semejkin_AV\\.nuget\\packages\\",
|
||||||
|
"outputPath": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\obj\\",
|
||||||
|
"projectStyle": "PackageReference",
|
||||||
|
"fallbackFolders": [
|
||||||
|
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||||
|
],
|
||||||
|
"configFilePaths": [
|
||||||
|
"C:\\Users\\Semejkin_AV\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||||
|
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||||
|
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||||
|
],
|
||||||
|
"originalTargetFrameworks": [
|
||||||
|
"netcoreapp3.1"
|
||||||
|
],
|
||||||
|
"sources": {
|
||||||
|
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||||
|
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||||
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp3.1": {
|
||||||
|
"targetAlias": "netcoreapp3.1",
|
||||||
|
"projectReferences": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"warningProperties": {
|
||||||
|
"warnAsError": [
|
||||||
|
"NU1605"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp3.1": {
|
||||||
|
"targetAlias": "netcoreapp3.1",
|
||||||
|
"imports": [
|
||||||
|
"net461",
|
||||||
|
"net462",
|
||||||
|
"net47",
|
||||||
|
"net471",
|
||||||
|
"net472",
|
||||||
|
"net48",
|
||||||
|
"net481"
|
||||||
|
],
|
||||||
|
"assetTargetFallback": true,
|
||||||
|
"warn": true,
|
||||||
|
"frameworkReferences": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"privateAssets": "all"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.400-preview.22301.10\\RuntimeIdentifierGraph.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
16
MonogameLabel/obj/MonogameLabel.csproj.nuget.g.props
Normal file
16
MonogameLabel/obj/MonogameLabel.csproj.nuget.g.props
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||||
|
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||||
|
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||||
|
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||||
|
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Semejkin_AV\.nuget\packages\;C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages</NuGetPackageFolders>
|
||||||
|
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||||
|
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.3.0</NuGetToolVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||||
|
<SourceRoot Include="C:\Users\Semejkin_AV\.nuget\packages\" />
|
||||||
|
<SourceRoot Include="C:\Program Files (x86)\Microsoft Visual Studio\Shared\NuGetPackages\" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
2
MonogameLabel/obj/MonogameLabel.csproj.nuget.g.targets
Normal file
2
MonogameLabel/obj/MonogameLabel.csproj.nuget.g.targets
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
|
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
|
74
MonogameLabel/obj/project.assets.json
Normal file
74
MonogameLabel/obj/project.assets.json
Normal file
|
@ -0,0 +1,74 @@
|
||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"targets": {
|
||||||
|
".NETCoreApp,Version=v3.1": {}
|
||||||
|
},
|
||||||
|
"libraries": {},
|
||||||
|
"projectFileDependencyGroups": {
|
||||||
|
".NETCoreApp,Version=v3.1": []
|
||||||
|
},
|
||||||
|
"packageFolders": {
|
||||||
|
"C:\\Users\\Semejkin_AV\\.nuget\\packages\\": {},
|
||||||
|
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages": {}
|
||||||
|
},
|
||||||
|
"project": {
|
||||||
|
"version": "1.0.0",
|
||||||
|
"restore": {
|
||||||
|
"projectUniqueName": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj",
|
||||||
|
"projectName": "MonogameLabel",
|
||||||
|
"projectPath": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj",
|
||||||
|
"packagesPath": "C:\\Users\\Semejkin_AV\\.nuget\\packages\\",
|
||||||
|
"outputPath": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\obj\\",
|
||||||
|
"projectStyle": "PackageReference",
|
||||||
|
"fallbackFolders": [
|
||||||
|
"C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages"
|
||||||
|
],
|
||||||
|
"configFilePaths": [
|
||||||
|
"C:\\Users\\Semejkin_AV\\AppData\\Roaming\\NuGet\\NuGet.Config",
|
||||||
|
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.FallbackLocation.config",
|
||||||
|
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
|
||||||
|
],
|
||||||
|
"originalTargetFrameworks": [
|
||||||
|
"netcoreapp3.1"
|
||||||
|
],
|
||||||
|
"sources": {
|
||||||
|
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
|
||||||
|
"C:\\Program Files\\dotnet\\library-packs": {},
|
||||||
|
"https://api.nuget.org/v3/index.json": {}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp3.1": {
|
||||||
|
"targetAlias": "netcoreapp3.1",
|
||||||
|
"projectReferences": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"warningProperties": {
|
||||||
|
"warnAsError": [
|
||||||
|
"NU1605"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netcoreapp3.1": {
|
||||||
|
"targetAlias": "netcoreapp3.1",
|
||||||
|
"imports": [
|
||||||
|
"net461",
|
||||||
|
"net462",
|
||||||
|
"net47",
|
||||||
|
"net471",
|
||||||
|
"net472",
|
||||||
|
"net48",
|
||||||
|
"net481"
|
||||||
|
],
|
||||||
|
"assetTargetFallback": true,
|
||||||
|
"warn": true,
|
||||||
|
"frameworkReferences": {
|
||||||
|
"Microsoft.NETCore.App": {
|
||||||
|
"privateAssets": "all"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.400-preview.22301.10\\RuntimeIdentifierGraph.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
8
MonogameLabel/obj/project.nuget.cache
Normal file
8
MonogameLabel/obj/project.nuget.cache
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
{
|
||||||
|
"version": 2,
|
||||||
|
"dgSpecHash": "GuTjaNW1kyQRhs8Q1u1GRgtNGJfpTPHLcEAL+P1F2jjRV37oir+kqpfDQBZes3GQpvzr1fukhjH4xyH8JzhpAQ==",
|
||||||
|
"success": true,
|
||||||
|
"projectFilePath": "C:\\Users\\Semejkin_AV\\Desktop\\Pacman_refactored\\MonogameLabel\\MonogameLabel.csproj",
|
||||||
|
"expectedPackageFiles": [],
|
||||||
|
"logs": []
|
||||||
|
}
|
|
@ -2,10 +2,10 @@
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
|
||||||
using Pacman_refactored.Classes.Interfaces;
|
using Pacman_refactored.Interfaces;
|
||||||
using System.Runtime.CompilerServices;
|
using Pacman_refactored.Enums;
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes
|
namespace Pacman_refactored.Classes.Entity
|
||||||
{
|
{
|
||||||
public abstract class Entity : IMovable, IRotatable, IAnimate
|
public abstract class Entity : IMovable, IRotatable, IAnimate
|
||||||
{
|
{
|
||||||
|
@ -27,9 +27,10 @@ namespace Pacman_refactored.Classes
|
||||||
public abstract int TextureNumber { get; set; }
|
public abstract int TextureNumber { get; set; }
|
||||||
public abstract int TextureCount { get; set; }
|
public abstract int TextureCount { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public virtual void Update(GameTime gameTime)
|
public virtual void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
Boundingbox = new Rectangle((int)Position.X, (int)Position.Y, (int)CellSize, (int)CellSize);
|
Boundingbox = new Rectangle((int)Position.X, (int)Position.Y, CellSize, CellSize);
|
||||||
IMovable.DirectionMove(Direction, Position, Speed, Game1.Map);
|
IMovable.DirectionMove(Direction, Position, Speed, Game1.Map);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,11 @@ using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Pacman_refactored.Classes.Interfaces;
|
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes
|
using Pacman_refactored.Interfaces;
|
||||||
|
using Pacman_refactored.Enums;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Entity
|
||||||
{
|
{
|
||||||
public class Ghost : Entity, IAnimate, IMovable
|
public class Ghost : Entity, IAnimate, IMovable
|
||||||
{
|
{
|
|
@ -1,9 +1,11 @@
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
using Pacman_refactored.Classes.Interfaces;
|
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes
|
using Pacman_refactored.Interfaces;
|
||||||
|
using Pacman_refactored.Enums;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Entity
|
||||||
{
|
{
|
||||||
public class Pacman : Entity, IMovable, IRotatable, IAnimate, IControl
|
public class Pacman : Entity, IMovable, IRotatable, IAnimate, IControl
|
||||||
{
|
{
|
|
@ -1,33 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes
|
|
||||||
{
|
|
||||||
public enum Direction
|
|
||||||
{
|
|
||||||
Up,
|
|
||||||
Down,
|
|
||||||
Left,
|
|
||||||
Right,
|
|
||||||
None
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum GameState
|
|
||||||
{
|
|
||||||
Game,
|
|
||||||
Menu,
|
|
||||||
GameOver,
|
|
||||||
NextLevel,
|
|
||||||
HowToPlay,
|
|
||||||
Exit
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum GhostType
|
|
||||||
{
|
|
||||||
Blinky,
|
|
||||||
Pinky,
|
|
||||||
Inky,
|
|
||||||
Clyde
|
|
||||||
}
|
|
||||||
}
|
|
23
Pacman_refactored/Classes/Food/Dot.cs
Normal file
23
Pacman_refactored/Classes/Food/Dot.cs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Food
|
||||||
|
{
|
||||||
|
public class Dot : Food
|
||||||
|
{
|
||||||
|
public override Texture2D Texture { get; set; }
|
||||||
|
|
||||||
|
public override Vector2 Position { get; set; }
|
||||||
|
public override int Scale { get; set; }
|
||||||
|
public override int CellSize { get; set; }
|
||||||
|
|
||||||
|
public override Rectangle SourceRect { get; set; }
|
||||||
|
public override Rectangle Boundingbox { get; set; }
|
||||||
|
|
||||||
|
public override int Prize { get; set; }
|
||||||
|
public override bool IsAlive { get; set; }
|
||||||
|
}
|
||||||
|
}
|
24
Pacman_refactored/Classes/Food/Energizer.cs
Normal file
24
Pacman_refactored/Classes/Food/Energizer.cs
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
using Pacman_refactored.Classes.Interfaces;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Food
|
||||||
|
{
|
||||||
|
public class Energizer : Food, IAnimate
|
||||||
|
{
|
||||||
|
public override Texture2D Texture { get; set; }
|
||||||
|
|
||||||
|
public override Vector2 Position { get; set; }
|
||||||
|
public override int Scale { get; set; }
|
||||||
|
public override int CellSize { get; set; }
|
||||||
|
|
||||||
|
public override Rectangle SourceRect { get; set; }
|
||||||
|
public override Rectangle Boundingbox { get; set; }
|
||||||
|
|
||||||
|
public override int Prize { get; set; }
|
||||||
|
public override bool IsAlive { get; set; }
|
||||||
|
}
|
||||||
|
}
|
29
Pacman_refactored/Classes/Food/Food.cs
Normal file
29
Pacman_refactored/Classes/Food/Food.cs
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Food
|
||||||
|
{
|
||||||
|
public abstract class Food
|
||||||
|
{
|
||||||
|
public abstract Texture2D Texture { get; set; }
|
||||||
|
|
||||||
|
public abstract Vector2 Position { get; set; }
|
||||||
|
public abstract int Scale { get; set; }
|
||||||
|
public abstract int CellSize { get; set; }
|
||||||
|
|
||||||
|
public abstract Rectangle SourceRect { get; set; }
|
||||||
|
public abstract Rectangle Boundingbox { get; set; }
|
||||||
|
|
||||||
|
public abstract int Prize { get; set; }
|
||||||
|
|
||||||
|
public abstract bool IsAlive { get; set; }
|
||||||
|
|
||||||
|
public void Draw(SpriteBatch spriteBatch)
|
||||||
|
{
|
||||||
|
if (IsAlive)
|
||||||
|
{
|
||||||
|
spriteBatch.Draw(Texture, Position, SourceRect, Color.White, 0, new Vector2(CellSize / 2), (float)Scale, SpriteEffects.None, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
23
Pacman_refactored/Classes/Food/Fruit.cs
Normal file
23
Pacman_refactored/Classes/Food/Fruit.cs
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.Food
|
||||||
|
{
|
||||||
|
public class Fruit : Food
|
||||||
|
{
|
||||||
|
public override Texture2D Texture { get; set; }
|
||||||
|
|
||||||
|
public override Vector2 Position { get; set; }
|
||||||
|
public override int Scale { get; set; }
|
||||||
|
public override int CellSize { get; set; }
|
||||||
|
|
||||||
|
public override Rectangle SourceRect { get; set; }
|
||||||
|
public override Rectangle Boundingbox { get; set; }
|
||||||
|
|
||||||
|
public override int Prize { get; set; }
|
||||||
|
public override bool IsAlive { get; set; }
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.UI.Label.Enums
|
||||||
|
{
|
||||||
|
public enum HoriZontalAlignment
|
||||||
|
{
|
||||||
|
Top,
|
||||||
|
Center,
|
||||||
|
Right
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.UI.Label.Enums
|
||||||
|
{
|
||||||
|
public enum VerticalAlignment
|
||||||
|
{
|
||||||
|
Top,
|
||||||
|
Center,
|
||||||
|
Bottom
|
||||||
|
}
|
||||||
|
}
|
30
Pacman_refactored/Classes/UI/Label/Label.cs
Normal file
30
Pacman_refactored/Classes/UI/Label/Label.cs
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
using Microsoft.Xna.Framework;
|
||||||
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.UI.Label
|
||||||
|
{
|
||||||
|
public class Label
|
||||||
|
{
|
||||||
|
public Vector2 Position { get; set; }
|
||||||
|
|
||||||
|
public SpriteFont SpriteFont { get; set; }
|
||||||
|
public Color Color { get; set; }
|
||||||
|
|
||||||
|
public string Text { get; set; }
|
||||||
|
|
||||||
|
public Label()
|
||||||
|
{
|
||||||
|
Position = new Vector2(0, 0);
|
||||||
|
Text = "Label";
|
||||||
|
Color = Color.White;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Label(SpriteFont sprteFont, string text, Vector2 position, Color color)
|
||||||
|
{
|
||||||
|
SpriteFont = sprteFont;
|
||||||
|
Text = text;
|
||||||
|
Position = position;
|
||||||
|
Color = color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
14
Pacman_refactored/Classes/UI/Menu.cs
Normal file
14
Pacman_refactored/Classes/UI/Menu.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
using Pacman_refactored.Enums;
|
||||||
|
using Pacman_refactored.Interfaces;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Classes.UI
|
||||||
|
{
|
||||||
|
public abstract class Menu : IControl
|
||||||
|
{
|
||||||
|
public abstract string[] MenuItems { get; set; }
|
||||||
|
}
|
||||||
|
}
|
15
Pacman_refactored/Enums/Direction.cs
Normal file
15
Pacman_refactored/Enums/Direction.cs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Enums
|
||||||
|
{
|
||||||
|
public enum Direction
|
||||||
|
{
|
||||||
|
Up,
|
||||||
|
Down,
|
||||||
|
Left,
|
||||||
|
Right,
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
16
Pacman_refactored/Enums/GameState.cs
Normal file
16
Pacman_refactored/Enums/GameState.cs
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Enums
|
||||||
|
{
|
||||||
|
public enum GameState
|
||||||
|
{
|
||||||
|
Game,
|
||||||
|
Menu,
|
||||||
|
GameOver,
|
||||||
|
NextLevel,
|
||||||
|
HowToPlay,
|
||||||
|
Exit
|
||||||
|
}
|
||||||
|
}
|
14
Pacman_refactored/Enums/GhostType.cs
Normal file
14
Pacman_refactored/Enums/GhostType.cs
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Text;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Enums
|
||||||
|
{
|
||||||
|
public enum GhostType
|
||||||
|
{
|
||||||
|
Blinky,
|
||||||
|
Pinky,
|
||||||
|
Inky,
|
||||||
|
Clyde
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,8 @@
|
||||||
using Microsoft.Xna.Framework.Graphics;
|
using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
|
|
||||||
|
using Pacman_refactored.Classes;
|
||||||
|
|
||||||
namespace Pacman_refactored
|
namespace Pacman_refactored
|
||||||
{
|
{
|
||||||
public class Game1 : Game
|
public class Game1 : Game
|
||||||
|
@ -9,11 +11,15 @@ namespace Pacman_refactored
|
||||||
private GraphicsDeviceManager _graphics;
|
private GraphicsDeviceManager _graphics;
|
||||||
private SpriteBatch _spriteBatch;
|
private SpriteBatch _spriteBatch;
|
||||||
|
|
||||||
|
public static Map Map;
|
||||||
|
|
||||||
public Game1()
|
public Game1()
|
||||||
{
|
{
|
||||||
_graphics = new GraphicsDeviceManager(this);
|
_graphics = new GraphicsDeviceManager(this);
|
||||||
Content.RootDirectory = "Content";
|
Content.RootDirectory = "Content";
|
||||||
IsMouseVisible = true;
|
IsMouseVisible = true;
|
||||||
|
|
||||||
|
Map = new Map();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Initialize()
|
protected override void Initialize()
|
||||||
|
|
|
@ -6,5 +6,11 @@ namespace Pacman_refactored.Classes.Interfaces
|
||||||
{
|
{
|
||||||
public interface IBoostable
|
public interface IBoostable
|
||||||
{
|
{
|
||||||
|
int BoostCooldown { get; set; }
|
||||||
|
|
||||||
|
void OnBoost(Entity entity)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -3,7 +3,9 @@ using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes.Interfaces
|
using Pacman_refactored.Enums;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Interfaces
|
||||||
{
|
{
|
||||||
public interface IControl
|
public interface IControl
|
||||||
{
|
{
|
|
@ -3,7 +3,10 @@ using Microsoft.Xna.Framework.Graphics;
|
||||||
using Microsoft.Xna.Framework.Input;
|
using Microsoft.Xna.Framework.Input;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes.Interfaces
|
using Pacman_refactored.Enums;
|
||||||
|
using Pacman_refactored.Classes;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Interfaces
|
||||||
{
|
{
|
||||||
public interface IMovable
|
public interface IMovable
|
||||||
{
|
{
|
|
@ -2,7 +2,9 @@
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Pacman_refactored.Classes.Interfaces
|
using Pacman_refactored.Enums;
|
||||||
|
|
||||||
|
namespace Pacman_refactored.Interfaces
|
||||||
{
|
{
|
||||||
public interface IRotatable
|
public interface IRotatable
|
||||||
{
|
{
|
Loading…
Add table
Reference in a new issue