if (key[KEY_ESC]) {closed = 1;}
if (key[KEY_W]) {jump = 1;}
if (key[KEY_A]) {ex = ex + rate;}
if (key[KEY_D]) {ex = ex - rate;}
if (ex <= 0) {ex = ex + rate;}
if (ex >= 1200) {ex = ex - rate;}
mapex = 0 - ex*2;
Instead of trying to link the sources files directly, use a header file.
1 2 3 4 5 6
#ifndef MAP_H
//Directives to avoid accidental redefining when header files is used in multiple source files
#define MAP_H
//Header file called "map.h" and filled with prototypes
void add_map();
#endif