Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Сулимов Игорь Андреевич
Pac-Man
Commits
ed2f7daa
Commit
ed2f7daa
authored
3 weeks ago
by
Сулимов Игорь Андреевич
Browse files
Options
Download
Patches
Plain Diff
FIxed bugs
parent
b9fb1513
main
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/Draw/Textures/Texture.h
+0
-2
include/Draw/Textures/Texture.h
include/MazeContent/Buildings/Teleport.h
+0
-1
include/MazeContent/Buildings/Teleport.h
source/MazeContent/Buildings/Teleport.cpp
+0
-51
source/MazeContent/Buildings/Teleport.cpp
with
0 additions
and
54 deletions
+0
-54
include/Draw/Textures/Texture.h
+
0
−
2
View file @
ed2f7daa
...
@@ -7,13 +7,11 @@
...
@@ -7,13 +7,11 @@
class
Texture
{
class
Texture
{
public:
public:
const
sf
::
Texture
&
get_texture
()
const
noexcept
{
return
m_texture
;
}
const
sf
::
Texture
&
get_texture
()
const
noexcept
{
return
m_texture
;
}
void
set_direction
(
config
::
Direction
dir
)
{
m_direction
=
dir
;
}
public
:
public
:
Texture
(
const
Texture
&
tex
)
=
delete
;
Texture
(
const
Texture
&
tex
)
=
delete
;
Texture
&
operator
=
(
const
Texture
&
tex
)
=
delete
;
Texture
&
operator
=
(
const
Texture
&
tex
)
=
delete
;
protected
:
protected
:
Texture
()
=
default
;
Texture
()
=
default
;
protected
:
protected
:
config
::
Direction
m_direction
=
config
::
Direction
::
RIGHT
;
sf
::
Texture
m_texture
;
sf
::
Texture
m_texture
;
};
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
include/MazeContent/Buildings/Teleport.h
+
0
−
1
View file @
ed2f7daa
...
@@ -14,7 +14,6 @@ public:
...
@@ -14,7 +14,6 @@ public:
Room
&
room5
,
Room
&
room6
,
Room
&
room7
,
Room
&
room8
);
Room
&
room5
,
Room
&
room6
,
Room
&
room7
,
Room
&
room8
);
private:
private:
std
::
vector
<
std
::
reference_wrapper
<
Room
>>
m_rooms
;
std
::
vector
<
std
::
reference_wrapper
<
Room
>>
m_rooms
;
// std::vector<std::array<sf::Vertex, 2>> lines;
std
::
vector
<
sf
::
RectangleShape
>
rectangles
;
std
::
vector
<
sf
::
RectangleShape
>
rectangles
;
float
line_thickness
=
5.0
f
;
float
line_thickness
=
5.0
f
;
};
};
\ No newline at end of file
This diff is collapsed.
Click to expand it.
source/MazeContent/Buildings/Teleport.cpp
+
0
−
51
View file @
ed2f7daa
...
@@ -16,52 +16,6 @@ Teleport::Teleport(Room& room1, Room& room2, Room& room3, Room& room4,
...
@@ -16,52 +16,6 @@ Teleport::Teleport(Room& room1, Room& room2, Room& room3, Room& room4,
m_rooms
.
emplace_back
(
std
::
ref
(
room8
));
m_rooms
.
emplace_back
(
std
::
ref
(
room8
));
}
}
//void Teleport::prepare_for_drawing() {
// for (size_t i = 0; i < m_rooms.size(); ++i) {
// sf::Vector2f pos = m_rooms.at(i).get().get_position();
// switch (m_rooms.at(i).get().get_direction(this)) {
// case Room::LEFT:
// lines.emplace_back(std::array<sf::Vertex, 2>{
// sf::Vertex{sf::Vector2f(pos.x - m_rooms.at(i).get().get_size() / 2,
// pos.y - m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT},
// sf::Vertex{sf::Vector2f(pos.x - m_rooms.at(i).get().get_size() / 2,
// pos.y + m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT}
// });
// break;
//
// case Room::RIGHT:
// lines.emplace_back(std::array<sf::Vertex, 2>{
// sf::Vertex{sf::Vector2f(pos.x + m_rooms.at(i).get().get_size() / 2,
// pos.y - m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT},
// sf::Vertex{sf::Vector2f(pos.x + m_rooms.at(i).get().get_size() / 2,
// pos.y + m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT}
// });
// break;
//
// case Room::UP:
// lines.emplace_back(std::array<sf::Vertex, 2>{
// sf::Vertex{sf::Vector2f(pos.x - m_rooms.at(i).get().get_size() / 2,
// pos.y - m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT},
// sf::Vertex{sf::Vector2f(pos.x + m_rooms.at(i).get().get_size() / 2,
// pos.y - m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT}
// });
// break;
//
// case Room::DOWN:
// lines.emplace_back(std::array<sf::Vertex, 2>{
// sf::Vertex{sf::Vector2f(pos.x - m_rooms.at(i).get().get_size() / 2,
// pos.y + m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT},
// sf::Vertex{sf::Vector2f(pos.x + m_rooms.at(i).get().get_size() / 2,
// pos.y + m_rooms.at(i).get().get_size() / 2), config::GAME_COLOR_TELEPORT}
// });
// break;
//
// default:
// throw std::runtime_error("Invalid side in the room!");
// }
// }
//}
void
Teleport
::
enter
(
IEntity
*
entity
)
{
void
Teleport
::
enter
(
IEntity
*
entity
)
{
size_t
number
=
m_rooms
.
size
();
size_t
number
=
m_rooms
.
size
();
for
(
size_t
i
=
0
;
i
<
number
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
number
;
++
i
)
{
...
@@ -70,11 +24,6 @@ void Teleport::enter(IEntity* entity) {
...
@@ -70,11 +24,6 @@ void Teleport::enter(IEntity* entity) {
}
}
}
}
//void Teleport::draw_into(sf::RenderWindow& window) const {
// for (const auto& line : lines)
// window.draw(line.data(), 2, sf::Lines);
//}
void
Teleport
::
prepare_for_drawing
()
{
void
Teleport
::
prepare_for_drawing
()
{
rectangles
.
clear
();
// Очищаем предыдущие фигуры
rectangles
.
clear
();
// Очищаем предыдущие фигуры
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Topics
Snippets