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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160
|
#include <allegro.h>
#include "House.h"
#include "ExampleColors.h"
#include "HelperFunctions.h"
//----Set Screen Resolution
ust XRES = 1024;
ust YRES = 600;
//----Set house center-------
Point* houseCenter = new Point(900,450);
//---Make 2 homes-------------
House* h = new House(houseCenter, new Point(150,150), WHITE, BLUE, 30,30,15,15);
//--------------------------
void ScreenSaver(Screen& Shape* shps[]);
int main(){
Screen scr(*BLACK, XRES,YRES); //Initialize screen
//Color* backCol = scr.getBg(); //create a variable to store background color
allegro_init();//Allegro initialization
install_keyboard();//Set up for keyboard input
//Set the graphics mode to a 320x240-pixel window.
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 320,240,0,0);
h->draw(scr);
ScreenSaver(scr& House*h[]);
///TransX( scr, h, h, -100,3,1);//moving house in x direction for -100 value
//TransXY( scr, h, h, -100,3,1)///moving house in x and y direction
//TransY( scr, h, h, -100,3,1)//moving house in y direction
//TransPXNY( scr, h, h, -100,3,1)//move house in +x and-y direction
//scr.refresh();
//scr.wait(6000); //wait for 6 seconds
//can also use system("pause") here instead;
return 0;
}
void ScreenSaver(Screen& House*h[])
{
int i;
while(!key[KEY_ESC]){//loop until user presses Esc key
clear_keybuf();
rest(10);
for(i=0;i<i-1;i++)
{
i++;
TransX( scr, h, h, i,3,1);
}
return (0);
}
END_OF_MAIN();
[/code]
#include <allegro.h>
#include "House.h"
#include "ExampleColors.h"
#include "HelperFunctions.h"
//----Set Screen Resolution
ust XRES = 1024;
ust YRES = 600;
//----Set house center-------
Point* houseCenter = new Point(900,450);
//---Make 2 homes-------------
House* h = new House(houseCenter, new Point(150,150), WHITE, BLUE, 30,30,15,15);
//--------------------------
void ScreenSaver(Screen& Shape* shps[]);
int main(){
Screen scr(*BLACK, XRES,YRES); //Initialize screen
//Color* backCol = scr.getBg(); //create a variable to store background color
allegro_init();//Allegro initialization
install_keyboard();//Set up for keyboard input
//Set the graphics mode to a 320x240-pixel window.
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 320,240,0,0);
h->draw(scr);
ScreenSaver(scr& House*h[]);
///TransX( scr, h, h, -100,3,1);//moving house in x direction for -100 value
//TransXY( scr, h, h, -100,3,1)///moving house in x and y direction
//TransY( scr, h, h, -100,3,1)//moving house in y direction
//TransPXNY( scr, h, h, -100,3,1)//move house in +x and-y direction
//scr.refresh();
//scr.wait(6000); //wait for 6 seconds
//can also use system("pause") here instead;
return 0;
}
void ScreenSaver(Screen& House*h[])
{
int i;
while(!key[KEY_ESC]){//loop until user presses Esc key
clear_keybuf();
rest(10);
for(i=0;i<i-1;i++)
{
i++;
TransX( scr, h, h, i,3,1);
}
return (0);
}
END_OF_MAIN();
[/code]
#include <allegro.h>
#include "House.h"
#include "ExampleColors.h"
#include "HelperFunctions.h"
//----Set Screen Resolution
ust XRES = 1024;
ust YRES = 600;
//----Set house center-------
Point* houseCenter = new Point(900,450);
//---Make 2 homes-------------
House* h = new House(houseCenter, new Point(150,150), WHITE, BLUE, 30,30,15,15);
//--------------------------
void ScreenSaver(Screen& Shape* shps[]);
int main(){
Screen scr(*BLACK, XRES,YRES); //Initialize screen
//Color* backCol = scr.getBg(); //create a variable to store background color
allegro_init();//Allegro initialization
install_keyboard();//Set up for keyboard input
//Set the graphics mode to a 320x240-pixel window.
set_gfx_mode(GFX_AUTODETECT_WINDOWED, 320,240,0,0);
h->draw(scr);
ScreenSaver(scr& House*h[]);
///TransX( scr, h, h, -100,3,1);//moving house in x direction for -100 value
//TransXY( scr, h, h, -100,3,1)///moving house in x and y direction
//TransY( scr, h, h, -100,3,1)//moving house in y direction
//TransPXNY( scr, h, h, -100,3,1)//move house in +x and-y direction
//scr.refresh();
//scr.wait(6000); //wait for 6 seconds
//can also use system("pause") here instead;
return 0;
}
void ScreenSaver(Screen& House*h[])
{
int i;
while(!key[KEY_ESC]){//loop until user presses Esc key
clear_keybuf();
rest(10);
for(i=0;i<i-1;i++)
{
i++;
TransX( scr, h, h, i,3,1);
}
return (0);
}
| |