Files
Geek_Josytick 07a568ff95 Cleanup
Split up main header file into smaller parts
Fixed Collision math
Updated Input
Removed pausing dead code
2021-01-04 01:15:33 +01:00

31 lines
790 B
C

#ifndef VECTOR2_H
#define VECTOR2_H
struct Vector2{
float x, y;
inline Vector2 operator + (Vector2 vec) {return {x+vec.x, y+vec.y};}
inline Vector2 operator - (Vector2 vec) {return {x+vec.x, y+vec.y};}
inline Vector2 operator * (Vector2 vec) {return {x+vec.x, y+vec.y};}
inline Vector2 operator / (Vector2 vec) {return {x+vec.x, y+vec.y};}
inline Vector2 operator * (int i) {return {x*i, y*i};}
inline Vector2 operator / (int i) {return {x/i, y/i};}
inline void operator += (Vector2 vec) {
x += vec.x;
y += vec.y;
}
inline void operator -= (Vector2 vec) {
x -= vec.x;
y -= vec.y;
}
inline void operator *= (Vector2 vec) {
x *= vec.x;
y *= vec.y;
}
inline void operator /= (Vector2 vec) {
x /= vec.x;
y /= vec.y;
}
};
#endif