Jump to content
  • Advertisement
Sign in to follow this  
copper103

Allegro tile program not working

This topic is 3329 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

this is the code: #include <allegro.h> int map[18][10]={{0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0}, {0,0,0,0,0,0,0,0,0,0},}; void setupgame(){ for(int i=0;i<=10;i++) { for(int t=0;t<=18;t++) { if(map[t]=0)rectfill(screen,i*20,t*20,(i+1)*20,(t+1)*20,makecol(255,0,0)); } } } int main(){ allegro_init(); install_keyboard(); set_color_depth(16); set_gfx_mode( GFX_AUTODETECT, 640, 480, 0, 0); setupgame(); while( !key[KEY_ESC]){ } return 0; } END_OF_MAIN(); The debugger shows no errors, but when I run it the screen goes black and nothing happens. Why?

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Erik Rufelt
Change if(map[t]=0) to if(map[t]==0), in setupgame. Comparison needs two equal signs.


thanks a lot, i didnt see that, it works now.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!