c++ - Checking for collision -
i'm coding game our final project in our major using allegro issues collision. game battleships , did after loading screen, screen appear wherein can select coordinates of ships using arrow keys , lock space bar. , if coordinates chose occupied space bar doesn't work. my problem can't check ships' length , width collision before placing. ships length , width considered when you've placed ship , next ship can overlap other ships. i've tried issues. , not part of grid cannot chosen though it's empty. void shipplacement(){ //something cursor ship placement shipx = 0; shipy = 0; while(!placed) { allegro_event ev; al_wait_for_event(prepqueue, &ev); if(ev.type == allegro_event_key_down) { switch(ev.keyboard.keycode) { case allegro_key_up: key[key_up] = true; break; case allegro_key_down: key[key_down] = true; break; case allegro_key_left: key[key_left] = ...