Project

General

Profile

Revision 162

each sprite should be loaded with the adequate function that sets its center correctly

View differences:

proj.c
23 23
#include "proj_func.h"
24 24

  
25 25
#ifdef DIOGO
26
    #include "shooter.xpm"
26
    #include "shooter.h"
27 27
    #include "pistol.xpm"
28 28
#endif
29 29

  
......
62 62

  
63 63
    #ifdef DIOGO
64 64
        paint_screen(0x777777);
65
        sprite_t *shooter = sprite_ctor((xpm_map_t)shooter_xpm); sprite_set_pos(shooter, 100, 100); sprite_set_center(shooter, 25, 25);
65
        sprite_t *shooter1 = get_shooter(); sprite_set_pos(shooter1, 100, 100);
66 66
        for(double angle = 0; angle < 6.29; angle += 0.01){
67
             sprite_set_angle(shooter, angle);
67
             sprite_set_angle(shooter1, angle);
68 68
             //paint_screen(0x777777);
69
             sprite_draw(shooter);
69
             sprite_draw(shooter1);
70 70
             tickdelay(micros_to_ticks(10000));
71 71
        }
72
        sprite_draw(shooter);
72
        sprite_dtor(shooter1);
73 73
    #endif
74 74

  
75 75
    /// loop stuff

Also available in: Unified diff