Project

General

Profile

Revision 231

shooting things, bit laggy, cause mostly known, to be fixed

View differences:

ent.c
59 59
}
60 60
double  (gunner_get_x)              (const gunner_t *p){ return p->x; }
61 61
double  (gunner_get_y)              (const gunner_t *p){ return p->y; }
62
double  (gunner_get_angle)          (const gunner_t *p){ return sprite_get_angle(p->dude); }
62 63
int     (gunner_get_health)         (const gunner_t *p){ return p->health; }
63 64
int     (gunner_get_curr_health)    (const gunner_t *p){ return p->current_health; }
64 65
int16_t (gunner_get_x_screen)       (const gunner_t *p){ return (p->x-x_origin)*scale; }
......
134 135
    p->x += p->vx;
135 136
    p->y += p->vy;
136 137
}
138

  
139
void (bullet_update_movement_list)(list_t *bullet_list){
140
    if (bullet_list == NULL) return;
141
    if (list_size(bullet_list) == 0) return;
142

  
143
    list_node_t *it = list_begin(bullet_list);
144
    while (it != list_end(bullet_list)) {
145
        bullet_update_movement(*(bullet_t**)list_node_val(it));
146
        it = list_node_next(it);
147
    }
148
}
149

  
137 150
void (bullet_draw)(bullet_t *p){
138 151
    const int16_t x_screen = bullet_get_x_screen(p);
139 152
    const int16_t y_screen = bullet_get_y_screen(p);
......
142 155
    sprite_draw     (p->b);
143 156
}
144 157

  
158
void (bullet_draw_list)(list_t *bullet_list) {
159
    if (bullet_list == NULL) return;
160
    if (list_size(bullet_list) == 0) return;
161

  
162
    list_node_t *it = list_begin(bullet_list);
163
    while (it != list_end(bullet_list)) {
164
        bullet_draw(*(bullet_t**)list_node_val(it));
165
        it = list_node_next(it);
166
    }
167
}
168

  
145 169
struct map{
146 170
    basic_sprite_t *bsp_background;
147 171
    sprite_t *background;

Also available in: Unified diff