Question: #include #include void init(); void deinit(); int main() { init(); // while (!key[KEY_ESC]) { int x=100, y=100 , numdots = 1000; int i , ax[1000],

#include  #include  void init(); void deinit(); int main() { init(); // while (!key[KEY_ESC]) { int x=100, y=100 , numdots = 1000; int i , ax[1000], ay[1000]; for (i = 0 ; i <=numdots ; ++i ) { /* 1000 dots in random positions and random colors*/ x=rand()%1000 ; ax[i] = x; y=rand()%1000 ; ay[i] = y; putpixel(screen, x, y, makecol(255, 255, 255)); } for (i = 0 ; i <=numdots ; i++ ) { /* move pixels outward */ x= ax[i]; y= ay[i]; // to move star, kill where it was putpixel(screen, x, y, makecol(0, 0, 0 )); if (x < 1000/2 ) x-- ; //move star to the left else x++ ; //move star to the rightt if (y < 1000/2 ) y-- ; //move star upward else y++ ;//move star downward ax[i] = x; ay[i] = y; // x=rand()%1000 ; y=rand()%1000 ; putpixel(screen, x, y, makecol(255, 255, 255)); } system("pause"); } deinit(); return 0; } END_OF_MAIN() void init() { int depth, res; allegro_init(); depth = desktop_color_depth(); if (depth == 0) depth = 32; set_color_depth(depth); res = set_gfx_mode(GFX_AUTODETECT_WINDOWED, 1000, 1000, 0, 0); if (res != 0) { allegro_message(allegro_error); exit(-1); } install_timer(); install_keyboard(); install_mouse(); /* add other initializations here */ } void deinit() { clear_keybuf(); /* add other deinitializations here */ } student submitted image, transcription available below

This program uses dev c++ and the code isnt working3

Make a star field as in Star Trek (the original series), like MS's screensaver. I want to fly! Hint: Store stars in an array. Erase when they move off screen and creat new stars in the middle of screen

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!