@@ -32,9 +32,9 @@ Graphics::Graphics(std::vector<std::vector<int>> the_maze, Coordinate start, Coo
3232 this ->sprite_sheet .loadFromFile (" mouse_and_cheese_sprite.png" );
3333
3434 Mouse.setTexture (this ->sprite_sheet );
35- Mouse.setTextureRect (IntRect (0 , 8 , 75 , 42 ));
36- this ->Mouse .setScale (2.0 / 5 .0 , 3.0 / 5 .0 );
37- this ->Mouse .setPosition (this ->StartOfMaze .X * 30 , this ->StartOfMaze .Y * 30 );
35+ Mouse.setTextureRect (IntRect (0 , 10 , 75 , 42 ));
36+ this ->Mouse .setScale (2.0 / 6 .0 , 3.0 / 6 .0 );
37+ this ->Mouse .setPosition (( this ->StartOfMaze .X * 30 )+ 15 , ( this ->StartOfMaze .Y * 30 )+ 15 );
3838 this ->Mouse .setOrigin (0 , 0 );
3939 Cheese.setTexture (this ->sprite_sheet );
4040 Cheese.setTextureRect (IntRect (160 , 8 , 75 , 50 ));
@@ -99,6 +99,7 @@ void Graphics::update()
9999 int y = 0 ;
100100 int x = 0 ;
101101
102+
102103 for (int square_counter = 0 ; square_counter < squares.size (); square_counter++)
103104 {
104105 if (std::find (path.begin (), path.end (), Coordinate (x, y)) != path.end ()) {
@@ -121,23 +122,23 @@ void Graphics::update()
121122 }
122123 if (mouse_pos < path.size ())
123124 {
124- if (this ->Mouse .getPosition ().x < path[mouse_pos].X *30 )
125+ if (this ->Mouse .getPosition ().x < ( path[mouse_pos].X *30 )+ 15 )
125126 {
126127 this ->move_mouse_right ();
127128 }
128- else if (this ->Mouse .getPosition ().x > path[mouse_pos].X * 30 )
129+ else if (this ->Mouse .getPosition ().x > ( path[mouse_pos].X * 30 )+ 15 )
129130 {
130131 this ->move_mouse_left ();
131132 }
132- else if (this ->Mouse .getPosition ().y < path[mouse_pos].Y * 30 )
133+ else if (this ->Mouse .getPosition ().y < ( path[mouse_pos].Y * 30 )+ 15 )
133134 {
134135 this ->move_mouse_down ();
135136 }
136- else if (this ->Mouse .getPosition ().y > path[mouse_pos].Y * 30 )
137+ else if (this ->Mouse .getPosition ().y > ( path[mouse_pos].Y * 30 )+ 15 )
137138 {
138139 this ->move_mouse_up ();
139140 }
140- else if (this ->Mouse .getPosition ().x == path[mouse_pos].X * 30 && this ->Mouse .getPosition ().y == path[mouse_pos].Y * 30 )
141+ else if (this ->Mouse .getPosition ().x == ( path[mouse_pos].X * 30 )+ 15 && this ->Mouse .getPosition ().y == ( path[mouse_pos].Y * 30 )+ 15 )
141142 {
142143 mouse_pos++;
143144 }
@@ -148,11 +149,11 @@ void Graphics::update()
148149 }
149150 if (this ->Mouse .getRotation () == 90 || this ->Mouse .getRotation () == 180 )
150151 {
151- this ->Mouse .setOrigin (75 , 42 );
152+ this ->Mouse .setOrigin (75 / 2 , 42 / 2 );
152153 }
153154 else
154155 {
155- this ->Mouse .setOrigin (0 , 0 );
156+ this ->Mouse .setOrigin (75 / 2 , 42 / 2 );
156157; }
157158 for (int i = 0 ; i < squares.size (); i++)
158159 {
0 commit comments