src/proto2/Graphics.cc
changeset 180 bfe1077edab3
parent 162 f760591b7481
child 182 84675387ca74
equal deleted inserted replaced
179:c600984d0428 180:bfe1077edab3
    49     if (keyboard.get_keycode(CL_KEY_RSHIFT))
    49     if (keyboard.get_keycode(CL_KEY_RSHIFT))
    50         input_move |= INPUT_MOVE_JUMP;
    50         input_move |= INPUT_MOVE_JUMP;
    51 
    51 
    52     if (keyboard.get_keycode(CL_KEY_I))
    52     if (keyboard.get_keycode(CL_KEY_I))
    53         player->debugInfo();
    53         player->debugInfo();
       
    54     
       
    55     if (keyboard.get_keycode(CL_KEY_F)) {
       
    56         Engine::log(DEBUG, "Graphics.check_input") << "Fire!";
       
    57         player->shoot();
       
    58     }
    54    
    59    
    55     if (keyboard.get_keycode(CL_KEY_M))
    60     if (keyboard.get_keycode(CL_KEY_M))
    56         input_move |= INPUT_MOVE_DIG;
    61         input_move |= INPUT_MOVE_DIG;
    57  
    62  
    58     // apply movement if applicable
    63     // apply movement if applicable
    73     for (std::list<Player*>::iterator it = state.player_list.begin(); it != state.player_list.end(); it++) {
    78     for (std::list<Player*>::iterator it = state.player_list.begin(); it != state.player_list.end(); it++) {
    74         Player *p = *it;
    79         Player *p = *it;
    75         p->draw(gc);
    80         p->draw(gc);
    76     }        
    81     }        
    77 
    82 
       
    83     // Draw projectiles
       
    84     for (std::list<PhysicsObject*>::iterator it = state.projectiles.begin(); it != state.projectiles.end(); it++) {
       
    85         PhysicsObject *po = *it;
       
    86         po->draw(gc);
       
    87     }        
       
    88 
    78     // Flip window buffer, LIEK NAO
    89     // Flip window buffer, LIEK NAO
    79     win.flip(0);
    90     win.flip(0);
    80 }
    91 }
    81 
    92 
    82 void Graphics::on_update (void) {
    93 void Graphics::on_update (void) {