def init():
    g = tilevid.Tilevid()

    ##In init(), set the g.view size so that all the handlers will work properly.  (The player_loop one depends on view having the correct size.)
    ##::
    g.view.w, g.view.h = SW, SH
    ##

    g.screen = pygame.display.set_mode((SW, SH), SWSURFACE)
    g.frame = 0

    g.tga_load_tiles('tiles.tga', (TW, TH), tdata)
    ##In init() I no longer have tga_load_level load the background layer, as
    ##we will generate our own multi-layered starfield.
    ##::
    g.tga_load_level('level.tga')
    ##
    g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW,
                           (len(g.tlayer) - 2) * TH)
    g.load_images(idata)
    g.run_codes(cdata, (0, 0, 25, 17))
    pygame.font.init()
    g.font = pygame.font.SysFont('helvetica', 16)

    return g
Exemple #2
0
    def __init__(self, screen):
        tilevid.Tilevid.__init__(self)
        self.screen = screen

        ## create a background layer
        self.bg = tilevid.Tilevid()

        self.num_bibles = base.num_bibles
        ## This is the rectangle that we're focusing on.
        self.focus_rect = (0, 0, 1, 1)

        ##                self.loadLevel(self.level_maj, self.level_min)

        ## Create a new HUD
        self.hud = hud.HUD(self)

        ##MAYO: add the Bible verse set up
        if base.gameDifficulty == 1:
            self.mybible = bibleverse("easy")
            print "easy"
        elif base.gameDifficulty == 2:
            self.mybible = bibleverse("medium")
            print "medium"
        elif base.gameDifficulty == 3:
            self.mybible = bibleverse("hard")
            print "hard"

        self.inputing = False
        self.retval = []

        # for testing
        self.safeMode = False
        self.player = None
Exemple #3
0
    def __init__(self, data):
        gui.Container.__init__(self)
        self.screen, lfname = data

        #Change later
        self.screen_w = base.SCREEN_WIDTH
        self.screen_h = base.SCREEN_HEIGHT
        self.tile_w = self.tile_h = base.TILE_SIZE

        self.level = tilevid.Tilevid()
				
        self.tiles_w, self.tiles_h = 0,0
        self.requiresSave = 0
				
        self.loadLevel(lfname)

        self.tile = 0
        self.code = 0
        
        self.mode = 'tile'
        self.modenum = 0
        self.clipboard = None
        self.history = []
        
        self.changes = []
        self.dirty = 0
Exemple #4
0
def init():
    g = tilevid.Tilevid()

    g.screen = pygame.display.set_mode((SW, SH), SWSURFACE)

    g.tga_load_tiles('tiles.tga', (TW, TH))
    g.tga_load_level('level.tga')

    return g
Exemple #5
0
def init():
    g = tilevid.Tilevid()

    g.screen = pygame.display.set_mode((SW, SH), SWSURFACE)

    ##In init(), this line has been changed to load the tiles with their properties (groups, functions, and config.
    ##::
    g.tga_load_tiles('tiles.tga', (TW, TH), tdata)
    ##
    g.tga_load_level('level.tga', 1)
    g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW,
                           (len(g.tlayer) - 2) * TH)
    g.load_images(idata)
    g.run_codes(cdata, (0, 0, 25, 17))
    pygame.font.init()
    g.font = pygame.font.SysFont('helvetica', 16)

    return g
def init():
    g = tilevid.Tilevid()
    
    g.screen = pygame.display.set_mode((SW,SH),SWSURFACE)
    
    g.tga_load_tiles('tiles.tga',(TW,TH))
    g.tga_load_level('level.tga',1)
    g.bounds = pygame.Rect(TW,TH,(len(g.tlayer[0])-2)*TW,(len(g.tlayer)-2)*TH)
    
    ##In init(), loading in the sprite images.
    ##::
    g.load_images(idata)
    ##
    
    ##In init(), running the codes for the initial screen.
    ##::
    g.run_codes(cdata,(0,0,25,17))
    ##
    
    return g
Exemple #7
0
def init():
    g = tilevid.Tilevid()

    g.screen = pygame.display.set_mode((SW, SH), SWSURFACE)

    g.tga_load_tiles('tiles.tga', (TW, TH))

    ##In init(), I add bg=1 to tga_load_level so that the background layer is
    ##also loaded.
    ##::
    g.tga_load_level('level.tga', 1)
    ##

    ##In init(), I also set the bounds of the level.  The view will never go
    ##outside the bounds of the level.
    ##::
    g.bounds = pygame.Rect(TW, TH, (len(g.tlayer[0]) - 2) * TW,
                           (len(g.tlayer) - 2) * TH)
    ##

    return g