Project

General

Profile

Revision 160

implemented sprite rotation

View differences:

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

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

  
29 30
int main(int argc, char* argv[]) {
......
60 61
    };
61 62

  
62 63
    #ifdef DIOGO
63
        sprite_t *sp = sprite_ctor((xpm_map_t)plus_xpm);
64
        sprite_draw(sp);
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);
66
        for(double angle = 0; angle < 6.29; angle += 0.01){
67
             sprite_set_angle(shooter, angle);
68
             //paint_screen(0x777777);
69
             sprite_draw(shooter);
70
             tickdelay(micros_to_ticks(10000));
71
        }
72
        sprite_draw(shooter);
65 73
    #endif
66 74

  
67 75
    /// loop stuff

Also available in: Unified diff