-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrobot.h
38 lines (30 loc) · 1.29 KB
/
robot.h
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
#ifndef ROBOT_H_INCLUDED
#define ROBOT_H_INCLUDED
#include "stdio.h"
#include "stdlib.h"
#include "sdl.h"
#include "SDL2_gfxPrimitives.h"
#include "formulas.h"
#include "time.h"
#include "wall.h"
#include "math.h"
//Setup
void setup_robot(struct Robot *robot);
//Error/Finish Checking
int robot_off_screen(struct Robot * robot);
int checkRobotHitWall(struct Robot * robot, struct Wall * wall);
int checkRobotHitWalls(struct Robot * robot, struct Wall_collection * head);
int checkRobotReachedEnd(struct Robot * robot, int x, int y, int width, int height);
void robotCrash(struct Robot * robot);
void robotSuccess(struct Robot * robot, int msec);
//Sensor Checking
int checkRobotSensor(int x, int y, int sensorSensitivityLength, int angle, struct Wall * wall) ;
int checkRobotSensorFrontRightAllWalls(struct Robot * robot, struct Wall_collection * head);
int checkRobotSensorFrontLeftAllWalls(struct Robot * robot, struct Wall_collection * head);
int checkRobotSensorFrontAllWalls(struct Robot * robot, struct Wall_collection * head);
//Visual Display
void robotUpdate(struct SDL_Renderer * renderer, struct Robot * robot);
//Movement
void robotMotorMove(struct Robot * robot);
void robotAutoMotorMove(struct Robot * robot, int front_left_sensor, int front_right_sensor, int front_sensor);
#endif // ROBOT_H_INCLUDED