main.c (raw)
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 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 |
#include <stdio.h> #include <time.h> #include <stdlib.h> #include <SDL/SDL.h> #include <SDL/SDL_image.h> #include <SDL/SDL_ttf.h> #include "config.h" #include "Engine.h" #include "Catbug.h" #include "Timer.h" #include "Pickups.h" int playing = 1; int quit = 0; int fullscreen = 0; int points = 0; int threshold = 10; int maxHP = STARTING_HP; time_t ticker; Timer fps; SDL_Event event; SDL_Surface* screen = NULL; SDL_Surface* window = NULL; SDL_Surface* score = NULL; SDL_Surface* bg = NULL; SDL_Surface* hpwedge = NULL; TTF_Font* font = NULL; TTF_Font* font2 = NULL; Catbug* player; Pickup** stuff; int main(int argc, char* args[]) { if (!init(argc, args)) { printf("Init failed\n"); return 1; } printf("Init complete\n"); while (playing) { title(); resetGame(); while(!quit) { timeStart(&fps); renderBG(); drawCatbug(player); moveCatbug(player); managePickups(); updateScore(); drawHP(); interact(); frameAdvance(); checkHP(); } } cleanup(); return 0; } |