Project

General

Profile

Revision 237

now loading bullet sprite only once

View differences:

proj.c
24 24
#include "shooter.h"
25 25
#include "pistol.h"
26 26
#include "nothing.h"
27
//#include "bullet.h"
27
#include "bullet.h"
28 28
#include "map1.h"
29 29

  
30 30
#include "list.h"
......
82 82
    basic_sprite_t       *bsp_shooter   = NULL;
83 83
    basic_sprite_t       *bsp_pistol    = NULL;
84 84
    basic_sprite_t       *bsp_nothing   = NULL;
85
    map_t                *map1      = NULL;
85
    basic_sprite_t       *bsp_bullet    = NULL;
86
    map_t                *map1          = NULL;
86 87
    sprite_t             *sp_crosshair  = NULL;
87 88
    {
88 89
        graph_clear_screen();
......
95 96
        bsp_shooter   = get_shooter  (); if(bsp_shooter   == NULL) printf("Failed to get shooter\n");
96 97
        bsp_pistol    = get_pistol   (); if(bsp_pistol    == NULL) printf("Failed to get pistol\n");
97 98
        bsp_nothing   = get_nothing  (); if(bsp_nothing   == NULL) printf("Failed to get nothing\n");
99
        bsp_bullet    = get_bullet   (); if(bsp_bullet    == NULL) printf("Failed to get bullet\n");
98 100
        map1          = get_map1     (); if(map1          == NULL) printf("Failed to get map1\n");
99 101

  
100 102
        sp_crosshair = sprite_ctor(bsp_crosshair); if(sp_crosshair == NULL) printf("Failed to get crosshair sprite\n");
......
275 277
                                    counter_mouse_ih = 0;
276 278

  
277 279
                                    if (last_lb ^ get_key_presses()->lb_pressed && get_key_presses()->lb_pressed) {
278
                                        shoot_bullet(shooter1, bullet_list);
280
                                        shoot_bullet(shooter1, bullet_list, bsp_bullet);
279 281
                                    }
280 282

  
281 283
                                    last_lb = get_key_presses()->lb_pressed;

Also available in: Unified diff