-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnetrek-graphics-test
52 lines (42 loc) · 1.5 KB
/
netrek-graphics-test
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
import netrek
import time
from netrek import options
class TestGalactic(netrek.PhaseFlightGalactic):
def cycle(self):
for angle in range(255):
netrek.me.sp_player(angle, 4, 2000+(angle*20), 2000+(angle*20))
netrek.other.sp_player((angle + 128) % 256, 4, 4000+(angle*20), 2000+(angle*20))
self.update()
time.sleep(.01)
netrek.pygame.display.flip()
class TestTactical(netrek.PhaseFlightTactical):
def cycle(self):
for angle in range(255):
netrek.me.sp_player(angle, 4, 2000+(angle*20), 2000+(angle*20))
netrek.other.sp_player((angle + 128) % 256, 4, 4000+(angle*20), 2000+(angle*20))
self.update()
time.sleep(.01)
netrek.pygame.display.flip()
def setup():
netrek.opt, args = options.parser.parse_args()
netrek.opt.chosen = 'No Server'
netrek.screen = netrek.pg_init()
netrek.me = netrek.Ship(1)
netrek.other = netrek.Ship(2)
netrek.other.sp_player_info(2,2)
netrek.me.sp_you(0,0,0,0,0,0,0,0,0,0,0,0)
netrek.me.sp_player_info(1, 1)
netrek.background = netrek.screen.copy()
def test_gal():
ph_galactic = TestGalactic()
netrek.ShipGalacticSprite(netrek.me).show()
netrek.ShipGalacticSprite(netrek.other).show()
ph_galactic.do()
def test_tac():
ph_tactical = TestTactical()
netrek.ShipTacticalSprite(netrek.me).show()
netrek.ShipTacticalSprite(netrek.other).show()
ph_tactical.do()
setup()
test_tac()
test_gal()