Original Post
Im making this allegro game. I keep getting errors i dont understand. It finishes compiling then gives me an error. The error is: Quote: .drectve '/DEFAULTLIB:"uuid.lib" /DEFFAULTLIB:"uuid.lib" 'unrecognized And heres my code: Code: - Cheers, Daniel [Edited by - 23yrold3yrold on January 23, 2007 5:20:18 AM]
#include <allegro.h> // include the basic allegro headers
#include <iostream>
using namespace std;
int x, y; // declare the x and y coordinators
int hp_cur, hp_max; // declare the hp_cur and hp_max variables
BITMAP *player = NULL; // declare the bitmap pointers
BITMAP *background = NULL; //
void check_input(); // set the prototype for check_input
int main() { // start the main function
allegro_init(); // initialize allegro
set_color_depth(32); // set the color depth
set_gfx_mode(GFX_AUTODETECT_FULLSCREEN, 1280, 1024, 0, 0); // set the screen resolution
install_timer(); // initialize the allegro timer,
install_keyboard(); // allegro key routines and
install_mouse(); // allegro mouse routines
player = load_bitmap( "player.bmp", NULL); // set the bitmap for the player
background = load_bitmap( "background.bmp", NULL); // set the bitmap for the background
int x = 300; // set the players starting coordinates
int y = 300; //
while (true) { // start the game loop
draw_sprite( screen, background, 0, 0); // draw the background
draw_sprite( screen, player, x, y); // draw the player
void check_input(); // check the input
} // end the game loop
} // end the main function
END_OF_MAIN() // allegro specific
void check_input() {
if (key[KEY_RIGHT]) { // if the right key is pressed
x + 5; // move the player
}
if (key[KEY_LEFT]) { // if the left key is pressed
x - 5; // move the player
}
if (key[KEY_UP]) { // if the up key is pressed
y + 5; // move the player
}
if (key[KEY_DOWN]) { // if the down key is pressed
y - 5; // move the player
}
if (key[KEY_ESC]) { // if the esc key is pressed
destroy_bitmap(player); //Release the bitmap data
destroy_bitmap(background); //Release the bitmap data
clear_keybuf(); // clear the keybuff
exit(1); // exit the game
}
}