Рукожаплю дизайн карты. Стенки, уголки. Не все.

This commit is contained in:
Mootfrost777 2022-06-29 00:27:11 +03:00
parent 4fa06158a0
commit 85686e83c0
45 changed files with 83 additions and 270 deletions

Binary file not shown.

Binary file not shown.

View file

@ -11,7 +11,7 @@ namespace Pacman.Classes
{
public class Map
{
private static List<Texture2D> textures = new List<Texture2D>();
private static Texture2D texture;
private string[,] map;
private int[,] dirs = { { -1, 0 }, { 0, -1 }, { 1, 0 }, { 0, 1 } };
@ -24,7 +24,7 @@ namespace Pacman.Classes
}
private Tuple<string, int[,]> GetCellType(int[] cords)
/*private Tuple<string, int[,]> GetCellType(int[] cords)
{
bool[] walls = new bool[4];
for (int i = 0; i < dirs.GetLength(0); i++)
@ -39,19 +39,13 @@ namespace Pacman.Classes
if (walls[0] == walls[2] && walls[0] == true)
{
return new Tuple<string, int[,]>("transit", { { cords[0] + dirs[1, 0], cords[1] + dirs[1, 1] },
}
}
}
}*/
public static void LoadContent(ContentManager Content)
{
textures.Add(Content.Load<Texture2D>("wall"));
textures.Add(Content.Load<Texture2D>("food"));
textures.Add(Content.Load<Texture2D>("energizer"));
textures.Add(Content.Load<Texture2D>("floor"));
textures.Add(Content.Load<Texture2D>("graph"));
texture = Content.Load<Texture2D>("sprites");
}
public void LoadMap()
@ -75,29 +69,38 @@ namespace Pacman.Classes
{
for (int j = 0; j < map.GetLength(1); j++)
{
Texture2D texture;
if (map[i, j] == "*")
Point pos;
Point size;
switch (map[i, j])
{
texture = textures[1];
case "┃":
pos = new Point(95, 240);
size = new Point(25, 60);
break;
case "━":
pos = new Point(0, 274);
size = new Point(60, 26);
break;
case ".":
pos = new Point(510, 0);
size = new Point(30, 30);
break;
case "┏":
pos = new Point(241, 241);
size = new Point(61, 57);
break;
default:
pos = new Point(0, 0);
size = new Point(0, 0);
break;
}
else if (map[i, j] == "#")
{
texture = textures[0];
}
else if (map[i, j] == "@")
{
texture = textures[2];
}
else if (map[i, j] == "&")
{
texture = textures[4];
}
else
{
texture = textures[3];
}
Rectangle rectangle = new Rectangle(new Point(j * 24, i * 24), new Point(24, 24));
spriteBatch.Draw(texture, rectangle, Color.White);
Rectangle sourceRect = new Rectangle(pos, size);
Rectangle destinationRect = new Rectangle(new Point(j * 24, i * 24), new Point(24, 24));
spriteBatch.Draw(texture,
destinationRect,
sourceRect,
Color.White);
}
}

View file

@ -13,7 +13,7 @@
#---------------------------------- Content ---------------------------------#
#begin energizer.png
#begin sprites.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
@ -23,53 +23,5 @@
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:energizer.png
#begin floor.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:floor.png
#begin food.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:food.png
#begin graph.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:graph.png
#begin wall.png
/importer:TextureImporter
/processor:TextureProcessor
/processorParam:ColorKeyColor=255,0,255,255
/processorParam:ColorKeyEnabled=True
/processorParam:GenerateMipmaps=False
/processorParam:PremultiplyAlpha=True
/processorParam:ResizeToPowerOfTwo=False
/processorParam:MakeSquare=False
/processorParam:TextureFormat=Color
/build:wall.png
/build:sprites.png

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.

Before

Width:  |  Height:  |  Size: 173 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

View file

@ -4,17 +4,9 @@
<Platform>Windows</Platform>
<Config />
<SourceFiles>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/energizer.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/floor.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/food.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/graph.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/wall.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png</File>
</SourceFiles>
<DestFiles>
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
</DestFiles>
</SourceFileCollection>

View file

@ -1,6 +1,2 @@
Source File,Dest File,Processor Type,Content Type,Source File Size,Dest File Size,Build Seconds
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/energizer.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/energizer.xnb","TextureProcessor","Texture2DContent",173,4181,0.2723272
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/floor.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/floor.xnb","TextureProcessor","Texture2DContent",133,4181,0.0095367
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/food.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/food.xnb","TextureProcessor","Texture2DContent",158,4181,0.0143045
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/graph.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/graph.xnb","TextureProcessor","Texture2DContent",138,4181,0.6631775
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/wall.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/wall.xnb","TextureProcessor","Texture2DContent",138,4181,0.0145956
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/sprites.xnb","TextureProcessor","Texture2DContent",24617,2304085,0.304181

View file

@ -4,17 +4,9 @@
<Platform>Windows</Platform>
<Config />
<SourceFiles>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/energizer.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/floor.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/food.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/graph.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/wall.png</File>
<File>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png</File>
</SourceFiles>
<DestFiles>
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
<File xsi:nil="true" />
</DestFiles>
</SourceFileCollection>

View file

@ -1,6 +1,2 @@
Source File,Dest File,Processor Type,Content Type,Source File Size,Dest File Size,Build Seconds
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/energizer.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/energizer.xnb","TextureProcessor","Texture2DContent",173,4181,0.2493217
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/floor.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/floor.xnb","TextureProcessor","Texture2DContent",133,4181,0.017288
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/food.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/food.xnb","TextureProcessor","Texture2DContent",158,4181,0.0096496
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/graph.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/graph.xnb","TextureProcessor","Texture2DContent",138,4181,0.3421807
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/wall.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/wall.xnb","TextureProcessor","Texture2DContent",138,4181,0.0136216
"C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png","C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/sprites.xnb","TextureProcessor","Texture2DContent",24617,2304085,0.5647778

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/energizer.png</SourceFile>
<SourceTime>2022-06-28T15:08:01.8828706+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/energizer.xnb</DestFile>
<DestTime>2022-06-28T15:16:35.7461052+03:00</DestTime>
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png</SourceFile>
<SourceTime>2022-06-29T00:11:51.2570572+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/Content/sprites.xnb</DestFile>
<DestTime>2022-06-29T00:11:52.956052+03:00</DestTime>
<Importer>TextureImporter</Importer>
<ImporterTime>2020-08-10T16:17:54+03:00</ImporterTime>
<Processor>TextureProcessor</Processor>

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/floor.png</SourceFile>
<SourceTime>2022-06-28T15:04:53.1875172+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/floor.xnb</DestFile>
<DestTime>2022-06-28T15:16:35.7690929+03:00</DestTime>
<Importer>TextureImporter</Importer>
<ImporterTime>2020-08-10T16:17:54+03:00</ImporterTime>
<Processor>TextureProcessor</Processor>
<ProcessorTime>2020-08-10T16:17:54+03:00</ProcessorTime>
<Parameters>
<Key>ColorKeyColor</Key>
<Value>255,0,255,255</Value>
</Parameters>
<Parameters>
<Key>ColorKeyEnabled</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>GenerateMipmaps</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>ResizeToPowerOfTwo</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>MakeSquare</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Color</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/food.png</SourceFile>
<SourceTime>2022-06-28T15:06:38.4441725+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/food.xnb</DestFile>
<DestTime>2022-06-28T15:16:35.7780997+03:00</DestTime>
<Importer>TextureImporter</Importer>
<ImporterTime>2020-08-10T16:17:54+03:00</ImporterTime>
<Processor>TextureProcessor</Processor>
<ProcessorTime>2020-08-10T16:17:54+03:00</ProcessorTime>
<Parameters>
<Key>ColorKeyColor</Key>
<Value>255,0,255,255</Value>
</Parameters>
<Parameters>
<Key>ColorKeyEnabled</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>GenerateMipmaps</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>ResizeToPowerOfTwo</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>MakeSquare</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Color</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/graph.png</SourceFile>
<SourceTime>2022-06-28T16:06:19.2221759+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/graph.xnb</DestFile>
<DestTime>2022-06-28T16:06:27.3493973+03:00</DestTime>
<Importer>TextureImporter</Importer>
<ImporterTime>2020-08-10T16:17:54+03:00</ImporterTime>
<Processor>TextureProcessor</Processor>
<ProcessorTime>2020-08-10T16:17:54+03:00</ProcessorTime>
<Parameters>
<Key>ColorKeyColor</Key>
<Value>255,0,255,255</Value>
</Parameters>
<Parameters>
<Key>ColorKeyEnabled</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>GenerateMipmaps</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>PremultiplyAlpha</Key>
<Value>True</Value>
</Parameters>
<Parameters>
<Key>ResizeToPowerOfTwo</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>MakeSquare</Key>
<Value>False</Value>
</Parameters>
<Parameters>
<Key>TextureFormat</Key>
<Value>Color</Value>
</Parameters>
<Dependencies />
<BuildAsset />
<BuildOutput />
</PipelineBuildEvent>

View file

@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<PipelineBuildEvent xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/wall.png</SourceFile>
<SourceTime>2022-06-28T15:08:18.2137875+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/wall.xnb</DestFile>
<DestTime>2022-06-28T15:16:35.7921079+03:00</DestTime>
<SourceFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/sprites.png</SourceFile>
<SourceTime>2022-06-29T00:11:51.2570572+03:00</SourceTime>
<DestFile>C:/Users/Semejkin_AV/Documents/Github_repos/Pacman/Pacman/Content/bin/Windows/sprites.xnb</DestFile>
<DestTime>2022-06-29T00:12:00.7044454+03:00</DestTime>
<Importer>TextureImporter</Importer>
<ImporterTime>2020-08-10T16:17:54+03:00</ImporterTime>
<Processor>TextureProcessor</Processor>

BIN
Pacman/Content/sprites.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 138 B

View file

@ -24,8 +24,8 @@ namespace Pacman
protected override void Initialize()
{
// TODO: Add your initialization logic here
_graphics.PreferredBackBufferWidth = 552;
_graphics.PreferredBackBufferHeight = 600;
_graphics.PreferredBackBufferWidth = 668;
_graphics.PreferredBackBufferHeight = 744;
_graphics.ApplyChanges();
base.Initialize();
@ -37,6 +37,7 @@ namespace Pacman
// TODO: use this.Content to load your game content here
Map.LoadContent(Content);
_map.LoadMap();
}
protected override void Update(GameTime gameTime)

Binary file not shown.

View file

@ -1,25 +1,31 @@
#######################
#**********#**********#
#@###*####*#*####*###@#
#*###*####*#*####*###*#
#*********************#
#*###*#*#######*#*###*#
#*****#*#######*#*****#
#####*#****#****#*#####
#####*####-#-####*#####
#####*#---------#*#####
#####*#-###-###-#*#####
-----*--#MM-MM#--*-----
#####*#-#######-#*#####
#####*#---------#*#####
#####*#-#######-#*#####
#####*#-#######-#*#####
#**********#**********#
#*###*####*#*####*###*#
#@**#******C******#**@#
###*#*#*#######*#*#*###
#*****#****#****#*****#
#*########*#*########*#
#*########*#*########*#
#*********************#
#######################
┏━━━━━━━━━━━━┓┏━━━━━━━━━━━━┓
┃........... ┃┃............┃
┃.┏━━┓.┏━━━┓.┃┃.┏━━━┓.┏━━┓.┃
┃O┃ ┃.┃ ┃.┃┃.┃ ┃.┃ ┃O┃
┃.┗━━┛.┗━━━┛.┗┛.┗━━━┛.┗━━┛.┃
┃..........................┃
┃.┏━━┓.┏┓.┏━━━━━━┓.┏┓.┏━━┓.┃
┃.┗━━┛.┃┃.┗━━┓┏━━┛.┃┃.┗━━┛.┃
┃......┃┃....┃┃....┃┃......┃
┗━━━━┓.┃┗━━┓ ┃┃ ┏━━┛┃.┏━━━━┛
┃.┃┏━━┛ ┗┛ ┗━━┓┃.┃
┃.┃┃ ┃┃.┃
┃.┃┃ ┏━━━━━━┓ ┃┃.┃
━━━━━┛.┗┛ ┃ ┃ ┗┛.┗━━━━━
. ┃ ┃ .
━━━━━┓.┏┓ ┃ ┃ ┏┓.┏━━━━━
┃.┃┃ ┗━━━━━━┛ ┃┃.┃
┃.┃┃ ┃┃.┃
┃.┃┃ ┏━━━━━━┓ ┃┃.┃
┏━━━━┛.┗┛ ┗━━┓┏━━┛ ┗┛.┗━━━━┓
┃............┃┃............┃
┃.┏━━┓.┏━━━┓.┃┃.┏━━━┓.┏━━┓.┃
┃.┗━┓┃.┗━━━┛.┗┛.┗━━━┛.┃┏━┛.┃
┃O..┃┃....... .......┃┃..O┃
┗━┓.┃┃.┏┓.┏━━━━━━┓.┏┓.┃┃.┏━┛
┏━┛.┗┛.┃┃.┗━━┓┏━━┛.┃┃.┗┛.┗━┓
┃......┃┃....┃┃....┃┃......┃
┃.┏━━━━┛┗━━┓.┃┃.┏━━┛┗━━━━┓.┃
┃.┗━━━━━━━━┛.┗┛.┗━━━━━━━━┛.┃
┃..........................┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━┛

View file

@ -40,3 +40,4 @@ C:\Users\Semejkin_AV\Documents\Github_repos\Pacman\Pacman\bin\Debug\netcoreapp3.
C:\Users\Semejkin_AV\Documents\Github_repos\Pacman\Pacman\bin\Debug\netcoreapp3.1\Content\food.xnb
C:\Users\Semejkin_AV\Documents\Github_repos\Pacman\Pacman\bin\Debug\netcoreapp3.1\Content\wall.xnb
C:\Users\Semejkin_AV\Documents\Github_repos\Pacman\Pacman\bin\Debug\netcoreapp3.1\Content\graph.xnb
C:\Users\Semejkin_AV\Documents\Github_repos\Pacman\Pacman\bin\Debug\netcoreapp3.1\Content\sprites.xnb