![]() |
homecontact ussitemapadvertising | |||
|
|
||||
The Free MMORPG Games- Free MMORPG - P2P Games - Open Beta - Closed Beta - Browser Based - Non-English - Other Free Games - Top 50
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Dante’s Inferno
|
Code:
#include <allegro.h>
void increment_speed_counter();
volatile long speed_counter = 0;
int main(int argc, char *argv[])
{
allegro_init();
install_keyboard();
install_timer();
LOCK_VARIABLE(speed_counter);
LOCK_FUNCTION(increment_speed_counter);
install_int_ex(increment_speed_counter, BPS_TO_TIMER(60));
set_color_depth(16);
set_gfx_mode(GFX_AUTODETECT, 640,480,0,0);
BITMAP *my_pic;
my_pic = load_bitmap("image.bmp", NULL);
BITMAP *buffer;
buffer = create_bitmap(640,480);
int my_pic_x = 0;
int my_pic_y = 0;
while(!key[KEY_ESC])
{
while(speed_counter > 0)
{
if(key[KEY_RIGHT])
{
my_pic_x++;
}
else if(key[KEY_LEFT])
{
my_pic_x--;
}
else if(key[KEY_UP])
{
my_pic_y--;
}
else if(key[KEY_DOWN])
{
my_pic_y++;
}
speed_counter--;
}
draw_sprite(buffer, my_pic, my_pic_x, my_pic_y);
blit(buffer, screen, 0,0,0,0,640,480);
clear_bitmap(buffer);
}
destroy_bitmap(my_pic);
destroy_bitmap(buffer);
return 0;
}
END_OF_MAIN();
void increment_speed_counter()
{
speed_counter++;
}
END_OF_FUNCTION(increment_speed_counter);
The file "image.bmp" DOES exist, but nothing shows up. Just blackness... Whats wrong? Last edited by naruto1327 : 07-24-2006 at 02:53 AM. |
|
|
|
|
|
#2 (permalink) |
|
Retired Staff
Join Date: May 2006
Posts: 2,026
MMOFaces Profile:
None Yet
|
Do you have the image.bmp in the same folder as the source code?
If you do, then maybe giving allegro a more specific path to use may help: Code:
my_pic = load_bitmap("c:\image.bmp", NULL);
|
|
|
|
|
|
#4 (permalink) | |
|
Bongo Crazy Kong
Join Date: Jul 2006
Posts: 232
Reputation: 10
MMOFaces Profile:
None Yet
|
Quote:
|
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Copyright © 2004-2007 BlueCastle Media |