This commit is contained in:
Bruno Rybársky 2022-05-29 10:22:29 +02:00
parent daf638d060
commit c5af2046e2

19
main.c

@ -1,10 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <stdint.h>
#include <ncurses.h>
#include <unistd.h>
#include <math.h>
uint16_t Hole_Div = 40;
uint16_t SCR_X;
uint16_t SCR_Y;
@ -124,16 +131,13 @@ void render_maze(){
if (letter == goal_char) {
rendered[(y) * SCR_X + (x)].color = goal_color;
}
else if (letter == player_char){
} else if (letter == player_char) {
rendered[(y) * SCR_X + (x)].color = player_color;
}
else if (letter == blank_char){
} else if (letter == blank_char) {
rendered[(y) * SCR_X + (x)].color = blank_color;
}
else if (letter == wall_char){
} else if (letter == wall_char) {
rendered[(y) * SCR_X + (x)].color = wall_color;
}
@ -249,8 +253,7 @@ int main(int argc, char *argv[]){
generate_maze();
render_maze();
draw_maze();
while (1)
{
while (1) {
inputs_tmp = keyinput();
if (inputs_tmp == 1) {
break;