-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMiniTest.cs
101 lines (72 loc) · 2.29 KB
/
MiniTest.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
using System;
using Spectre.Console;
using Resourses.Logic;
using Resourses.Visual;
namespace Pro001;
class MiniTest
{
public static void Run()
{
//GeneratedMaze001();
MovementTest001();
}
public static void GeneratedMaze001()
{
Maze maze = new(4, 7);
maze.Create(Maze.Type.Standard);
Camera.AllMapFixed(maze).Print();
}
public static void MovementTest001()
{
Maze maze = new(4, 7);
maze.Create(Maze.Type.Standard);
Player player1 = new("Pepe", 0,0);
player1.SetPosition(3,3);
Image playerTxtr = new Image(1,1);
playerTxtr.SetPixel(0,0, Textures.GetTxtr(Textures.Txtr.player1));
Image outputImage = new Image(15,15);
/*
Menue menue = new Menue("-----options-----", ['w','s','a','d','x'],
["move up", "move down", "move left", "move right", "exit"],
new Menue.OptionMethod[]{player1.MoveUp(maze), player1.MoveDown(maze), player1.MoveLeft(maze), player1.MoveRight(maze), Program.CloseAplication});
*/
while (true)
{
outputImage = Image.AddLayer(new Image(15,15),
Camera.RoomAll(maze.GetRoom(player1.GetMazeRoomPos())),
7 - player1.GetRow(), 7 - player1.GetCol());
Image.AddLayer(outputImage, playerTxtr, 7,7).Print();
char keyChar = Caption.GetKey_asChar();
if(keyChar == 'w')
{
player1.MoveUp(maze);
}
else if(keyChar == 's')
{
player1.MoveDown(maze);
}
else if(keyChar == 'a')
{
player1.MoveLeft(maze);
}
else if(keyChar == 'd')
{
player1.MoveRight(maze);
}
else if(keyChar == 'x')
{
Program.CloseAplication();
}
//Program.ClearConsole();
}
}
public static void PaintingRooms()
{
int[,] metaRoom = new int[5,5];
//metaRoom =
Room room = new();
}
public static void GeneratedMaze()
{
}
}