All pastes #254924 Raw Edit

Polarity

public cpp v1 · immutable
#254924 ·published 2006-11-22 14:08 UTC
rendered paste body
#include <allegro.h>int main(int argc, char *argv[]) {     int screenx = 640;    int screeny = 480;    BITMAP *buffer = NULL;        BITMAP *player = NULL;    player = load_bitmap("player.bmp", NULL);    int playerx = 50;    int playery = 50;        allegro_init();     install_keyboard();    set_color_depth(16);    set_gfx_mode(GFX_AUTODETECT, screenx,screeny,0,0);	buffer = create_bitmap(screenx,screeny);		while(!key[KEY_ESC])	{		if(key[KEY_RIGHT])		{ 			playerx ++; 		} 		else if(key[KEY_LEFT])		{ 			playerx --;		}		else if(key[KEY_UP])		{			playery --;		} 		else if(key[KEY_DOWN])		{ 			playery ++; 		}        							draw_sprite(buffer, player, playerx, playery);		blit(buffer, screen, 0,0,0,0,screenx,screeny);		clear_bitmap(buffer);	}							destroy_bitmap(player);	destroy_bitmap(buffer);	return 0;} END_OF_MAIN()