1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import fbpy.sprite
import fbpy.fb as fb
import numpy as np
import time

if __name__ == "__main__":

    #need it, else sprite will give typerror
    main = fb.Surface()

    timew = fb.Surface((0,0),(300,10))

    sprite = fbpy.sprite.Sprite((0,0),(150,157))
    sprite.surface.clear()
    sprite.surface.blit("./fighter_viper_mk1small.png")
    sprite.save()
    for i in range(160):

        sprite.surface.clear()
        sprite.surface.blit("./fighter_viper_mk1small.png")
        sprite.surface.trafo.identity()
        sprite.surface.trafo.rotate(6.28/160.0*i)
        sprite.surface.styledredraw()
        sprite.save()

    main.keepbackground()    
    main.blit("./stars.png")
    main.update()

    tnull = time.time()
    #make it move and debug
    counter = 0
    nom=0
    #for j in range(3):
       # for i in range(0,301,1):
       #     t0 = time.time()

       #     t = i/300.0*2*np.pi
       #     x = -200*np.cos(t)+600
       #     y = 20*np.sin(t)+300
       #     
       #     nom = int(i/300.0*160)
       #     sprite.moveto((x,y), nom)

       #     counter +=1

       #     if not (counter % 50):
       #         timew.clear()
       #         timew.printxy((3,3),"runtime = {0} s".format(time.time()-tnull),1)
       #         timew.update()

       #     while((time.time()-t0)<0.005):
       #         pass



    for i in range(300,-300,-1):
       # timew.clear()
       # timew.printxy((3,3),"frame = {0} s".format(i),1)
       # timew.update()

        sprite.moveto((i,300),1)
        time.sleep(0.01)

    sprite.moveto((100,100),1)

    s = raw_input()

    sprite.hide()