Commit b01ca3ba authored by Ivo Júnior's avatar Ivo Júnior
Browse files

Merge branch 'develop' of gitlab.c3sl.ufpr.br:bft15/boulder-dash-ASCII into develop

parents a28ecdf2 9fc3c0f4
File added
#include <stdio.h>
int main() {
int i, j;
for (i = 0; i < 20; i++) {
for (j = 0; j < 40; j++)
printf("a");
printf("\n");
}
return 0;
}
oooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
oooaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaao
......@@ -33,7 +33,8 @@ int update() {
void render(int need) {
clear();
while (need > 0) {
renderMap(&level);
/*while (need > 0) {
// if (need > NVALUE)
// renderN();
// need -= NVALUE;
......@@ -41,6 +42,6 @@ void render(int need) {
renderMap();
need -= MAPVALUE;
}
}
}*/
refresh();
}
#include "maps.h"
// Traduzir conteudo de "sprites" e imprimir na tela
#include <stdio.h>
void readFileMap(map *m) {
int i, j;
char input, block;
m->sprite = fopen("../sprites/map1", "r");
for (i = 0; i < WIDTH; i++) {
for (j = 0; j < HEIGHT; j++) {
fscanf(m->sprite, "%c", &input);
switch (input)
char input[WIDTH];
m->sprite = fopen("/home/bcc/bft15/2o Periodo/Oficina/Trabalhos/boulder-dash-ASCII/sprites/map1", "r");
for (i = 0; i < HEIGHT; i++) {
fscanf(m->sprite, "%s", input);
for (j = 0; j < WIDTH; j++) {
// tradução vai aqui
m->grid[i][j] = block;
m->grid[j][i] = input[j];
}
}
fclose(m->sprite);
}
int updateMap() {
return MAPVALUE;
}
void renderMap(map *m) {
int i, j;
for (i = 0; i < WIDTH; i++) {
for (j = 0; j < HEIGHT; j++) {
mvprintw(j, i, m->grid[i][j]);
}
}
for (i = 0; i < WIDTH; i++)
for (j = 0; j < HEIGHT; j++)
mvprintw(j+1, i+1, "%c", m->grid[i][j]);
}
......@@ -4,6 +4,6 @@
void readFileMap();
int updateMap();
void renderMap();
void renderMap(map *m);
#endif
......@@ -3,8 +3,8 @@
#include <curses.h>
#include <stdlib.h>
#include <unistd.h>
#define WIDTH 300
#define HEIGHT 300
#define WIDTH 40
#define HEIGHT 20
#include "entity.h"
#define TRUE 1
#define FALSE 0
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment