-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmap.cpp
46 lines (32 loc) · 1.04 KB
/
map.cpp
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
/*
* map.hpp
*
* Description: This file contains the implementation of the draw_map function, which is responsible for drawing the game map.
* It draws the endzone, river, middle intersection, and start areas using various shapes and colors.
*
* Author: Brandon Xu
* Date: 4/28/23
*/
#include "map.hpp"
void draw_map(sf::RenderWindow& window)
{
// Endzone
sf::RectangleShape endZone(sf::Vector2f(1200, 50));
endZone.setFillColor(sf::Color::Green);
endZone.setOrigin(sf::Vector2f(0, 0));
window.draw(endZone);
sf::RectangleShape river(sf::Vector2f(1200, 300));
river.setFillColor(sf::Color::Blue);
river.setOrigin(sf::Vector2f(0, -50));
window.draw(river);
// Middle intersection
sf::RectangleShape mid(sf::Vector2f(1200, 50));
mid.setFillColor(sf::Color(100, 100, 100));
mid.setOrigin(sf::Vector2f(0, -350));
window.draw(mid);
// Start
sf::RectangleShape start(sf::Vector2f(1200, 100));
start.setFillColor(sf::Color(100, 100, 100));
start.setOrigin(sf::Vector2f(0, -700));
window.draw(start);
}