Commit 4288a421 authored by Bruno Freitas Tissei's avatar Bruno Freitas Tissei
Browse files

nada

No related merge requests found
Showing with 56 additions and 6 deletions
+56 -6
......@@ -23,7 +23,7 @@ Para enviar mudanças:
```bash
$ git add example.c
$ git commit -m "Descrição das mudanças"
$ git commit push -u origin master
$ git push -u origin master
```
Para atualizar código local em relação ao repositório:
......
#!/bin/bash
gcc src/*.c -o temp -l curses
gcc src/main.c src/game.c src/timehelper.c -Wall -o temp -l curses
./temp
rm temp
File moved
LDLIBS= -lncurses
all: main
main: main.c main.h utils.h game.h
entity.o: entity.c entity.h utils.h
game.o: game.c game.h utils.h timeHelper.h
gui.o: gui.c utils.h
maps.o: maps.c utils.h
physics: physics.c utils.h
rockford: rockford.c utils.h
clear:
rm *~ *.o main
#include "entity.h"
#ifndef _ENTITY_H
#define _ENTITY_H
#include "utils.h"
#endif
......@@ -3,16 +3,16 @@
int x = 0, y = 0;
void run(int running) {
double last_time, current_time, elapsed_time, delta = FPS;
double last_time, current_time, /*elapsed_time,*/ delta = FPS;
int sleep_time;
last_time = getTime() / NANO;
while (running) {
current_time = getTime() / NANO;
render();
if (current_time >= last_time) {
last_time += delta;
getInput();
render();
update();
} else {
sleep_time = (int) ((last_time - current_time));
......
#include "gui.h"
// Scoreboard, menu, levels e hub
#ifndef _GUI_H
#define _GUI_H
#include "utils.h"
#endif
#include "maps.h"
// Traduzir conteudo de "sprites" e imprimir na tela
#ifndef _MAPS_H
#define _MAPS_H
#include "utils.h"
#endif
#include "physics.h"
// Controlar o movimento das pedras e tempo de explosão
#ifndef _PHYSICS_H
#define _PHYSICS_H
#include "utils.h"
#endif
#include "rockford.h"
#include "rockford.h"//game character
......@@ -3,7 +3,7 @@
#include "utils.h"
#include <sys/time.h>
#define NANO 1000000000.0
#define FPS 1.0/20.0
#define FPS 1.0/24.0
double getTime();
......
......@@ -2,6 +2,7 @@
#define _TYPES_H
#include <curses.h>
#include <stdlib.h>
#include <unistd.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