mirror of
https://github.com/GeekJoystick/game-and-watch-game-engine.git
synced 2025-12-17 01:16:10 +01:00
Split up main header file into smaller parts Fixed Collision math Updated Input Removed pausing dead code
31 lines
790 B
C
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 |