1 """<title>tutorial on how to load tiles and levels with isovid.</title>
3 <p>you should go through the tilevid tutorials before you view these. isovid
4 is just another vid interface.
6 <pre>$ leveledit isolevel.tga isotiles.tga isocodes.tga 32 64 --iso
7 C:\pgu\examples> python ../scripts/leveledit isolevel.tga isotiles.tga isocodes.tga 32 64 --iso</pre>
9 <p>the next time you run leveledit, you will not need to provide
10 the tiles, codes, and width and height of the tiles
14 from pygame.locals import *
16 # the following line is not needed if pgu is installed
17 import sys; sys.path.insert(0, "..")
19 from pgu import isovid
24 ##This is the initialization function I created for
27 ##I use the tga_ methods to load up the tiles and level I created.
32 g.screen = pygame.display.set_mode((SW,SH),SWSURFACE)
34 g.tga_load_tiles('isotiles.tga',(TW,TH))
35 g.tga_load_level('isolevel.tga',1)
43 ##This is the run function I created for the game. In this example,
44 ##the level is displayed, but there is no interaction (other than allowing the
45 ##user to quit via ESC or the QUIT signal.
54 for e in pygame.event.get():
55 if e.type is QUIT: g.quit = 1
56 if e.type is KEYDOWN and e.key == K_ESCAPE: g.quit = 1
59 updates = g.update(g.screen)
60 pygame.display.update(updates)