-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSun.h
More file actions
39 lines (35 loc) · 737 Bytes
/
Sun.h
File metadata and controls
39 lines (35 loc) · 737 Bytes
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
/*
Muhammad Taha Rizwan 23I-0664
Muhammad Aqib 23I-0670
Section - G
*/
#pragma once
#ifndef Position_h
#include "Position.h"
#include "SFML/Graphics.hpp"
class Sun {
Position pos;
int sunProduced;
bool collected;
sf::Texture sunTexture;
double textureX, textureY;
sf::Sprite sunSprite;
int sprites;
sf::Clock sClock;
public:
//Sun Class
Sun(int x = 200, int y = -10);
//Draw Sun
void draw(sf::RenderWindow& window);
//Movement of Sun
void move();
//check if SUn is collected
bool collectSun(sf::Event& event, sf::RenderWindow& window);
//check if sun is clicked
bool isClicked(sf::Vector2f& mousePos);
void appear();
bool isCollected()const;
int getSunProduced()const;
sf::Sprite getSprite()const;
};
#endif