Arch Game Engine  0.2
physics-tmp.h
1 #ifndef PHYSICS_H
2 #define PHYSICS_H
3 
4 #include <SDL2/SDL.h>
5 using namespace std;
6 #include <iostream>
7 #include <math.h> //This library has functions for math, like cos() thought I don't know exactly how to use it all, nonetheless it should be simple
8 
9 #include "object.h"
10 //Use this class to create and load in objects
11 //As of now (for things that can help you) this class stores an objects coordinates and size
12 //It stores other things, like its image, but those don't help you
13 //Eventually there will be other things added on or new classes that inherit it that can pass more variables to you
14 //The class has a function called getDest() which will return a SDL_Rect that stores its coordinates
15 //It also has setDX(int x) and setDY(int y) for setting its coordinates
16 //There is also setAng(int ang) and getAng() that you can use to figure out the objects angle/direction
17 //But like I said, soon it will hold other variables, such as weight, speed, etc. for physics
18 //I don't have any example functions that need to be created so just have at it and create whatever functions you want
19 //Below and in the .cpp file I have an example function that moves an object towards another object
20 
21 
23 class Physics {
24 public:
25  Physics();
26  ~Physics();
27  //This function will take two sets of points, and return the next of coordinates based on a set speed that head towards the second coordinate (des)
29  Object moveTowards(Object cur, Object des);
30  //this function can be remade with different parameters
31  //for example say you want an object to just move towards coordinates instead of an object you could do this:
32  //SDL_Rect moveTowards(Object cur, int x, int y);
33 private:
34 };
35 
36 #endif //PHYSICS_H
This class stores information for an Object in the game.
Definition: object.h:12
Class for doing physics functions.
Definition: physics-tmp.h:23