示例#1
0
def btimer_new(g,pos):
	s = tilevid.Sprite(pygame.Surface((1,1)),(0,0))
	s.pos = pos
	s.timer = 60
	s.loop = btimer_loop
	s.color = 0,0,0,CALPHA
	g.sprites.append(s)
示例#2
0
    def bible_block(g, t, a):
        def bible_pickup(g, s, a):
            if base.SOUND:
                base.sound.Play("BiblePickup")

            g.sprites.remove(s)
            #MAYO get the Bible verse and show it
            g.retval = g.mybible.getverse()
            g.inputing = False
            if g.retval[1]:
                #g.hud.show_dialog(_("""Damaged Bible! Type in the blank word to keep the bible"""));
                g.inputing = True
                g.hud.show_dialog(_("Damaged Bible! " + g.retval[0]))
            else:
                g.num_bibles += 1
                base.num_bibles = g.num_bibles
                g.hud.show_dialog(_(g.retval[0]))
            g.OnBiblePickedUp(s, s.tilepos)

        s = tilevid.Sprite(g.images['bible'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = bible_pickup

        s.tilepos = (t.rect.x / TILE_SIZE, t.rect.y / TILE_SIZE
                     )  # this can be used to identify the specific bible
示例#3
0
    def OnRunSpecial6(self, g, t, a):
        def special_hit6(g, s, a):
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit6
示例#4
0
	def OnRunSpecial5(self, g, t, a):
		def special_hit5(g, s, a):
			self.hud.show_dialog(_("""This is the southern bridge. Be careful, it's not in good condition."""))			
			s.agroups = None
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit5
示例#5
0
	def OnRunSpecial8(self, g, t, a):
		def special_hit(g, s, a):
			#g.hud.show_dialog(_("\"I've got an uneasy feeling about this...\""));
			self.gotoNextLevel()
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#6
0
	def OnRunSpecial6(self, g, t, a):
		def special_hit(g, s, a):
			g.hud.show_dialog(_("The sign reads:\n\t\"PROCEED WITH CAUTION: Dangerous mines ahead.\""));
			s.agroups = None
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#7
0
	def OnRunSpecial7(self, g, t, a):
		def special_hit(g, s, a):
			#g.hud.show_dialog(_("The sign reads:\n\t\"DANGER: Last chance to turn back!\""));
			s.agroups = None
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#8
0
	def OnRunSpecial5(self, g, t, a):
		def special_hit(g, s, a):
			g.hud.add_pending_dialog(_("The sign reads:\n\t\"To mine exit --->\""));
			s.agroups = None
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#9
0
    def exit_block(g, t, a):
        def exit_hit(g, s, a):
            #base.sound.Play("LevelExit");
            g.OnExit()

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = exit_hit
示例#10
0
	def OnRunSpecial2(self, g, t, a):
		def special_hit(g, s, a):
			g.hud.add_pending_dialog(_("\"Try jumping on the stepping stones to cross the waterfall.\""));
			s.agroups = None
		
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#11
0
    def OnRunSpecial4(self, g, t, a):
        def special_hit4(g, s, a):
            g.quake = 25
            self.FallingRoof2(g)

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit4
示例#12
0
def explosion_new(g,pos):
	s = tilevid.Sprite(g.images['explosion.0'],(pos[0]*TW+TW/2,pos[1]*TH+TH/2))
	s.color = (255,255,255,CALPHA)
	g.sprites.append(s)
	s.loop = explosion_loop
	s.frame = 0
	s.pos = pos
	explosion_blast(g,s.pos,1)
	s.type = 'explosion'
示例#13
0
    def bananas_block(g, t, a):
        def pickup(g, s, a):
            #base.sound.Play("");
            g.player.onPickupBanana(g, 3)
            g.sprites.remove(s)

        s = tilevid.Sprite(g.images['bananas'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = pickup
示例#14
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit1(g, s, a):
            g.quake = 25
            s.agroups = None  ## Remove the groups from colliding with this object in the future
            self.launchStone((0, 14), 5)

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit1
示例#15
0
	def OnRunSpecial2(self, g, t, a):
		def special_hit2(g, s, a):
			s.agroups = None	## Remove the groups from colliding with this object in the future	
			g.hud.add_pending_dialog(_("""Tip: To jump on to this bridge press the spacebar while
holding down the right arrow key.
\tThis will make Dave jump to the right."""))
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')	## Set the 'player' group to collide with this object
		s.hit = special_hit2
示例#16
0
    def OnRunSpecial4(self, g, t, a):
        def trig(g, s, a):
            s.agroups = None  ## Remove the groups from colliding with this object in the future
            g.quake = 25
            self.launchStone((80, 3), -8)

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = trig
示例#17
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit1(g, s, a):
            #g.hud.show_dialog(_("\"Wow, a hidden passage!\""));
            s.agroups = None  ## Remove the groups from colliding with this object in the future

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups(
            'player')  ## Set the 'player' group to collide with this object
        s.hit = special_hit1
示例#18
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit1(g, s, a):
            print "trigger 1"
            s.agroups = None  ## Remove the groups from colliding with this object in the future

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups(
            'player')  ## Set the 'player' group to collide with this object
        s.hit = special_hit1
示例#19
0
def player_new(g, t, value):
    g.clayer[t.ty][t.tx] = 0
    s = tilevid.Sprite(g.images['player'], t.rect)
    g.sprites.append(s)
    s.loop = player_loop
    ##In player_new() I add the player to the 'player' group, and set the score to 0. I also set the game's player to this Sprite.
    ##::
    s.groups = g.string2groups('player')
    s.score = 0
    g.player = s
示例#20
0
    def OnRunSpecial3(self, g, t, a):
        def special_hit3(g, s, a):
            g.hud.add_pending_dialog(
                _("""\"Hrmm. This bridge is in bad condition.\""""))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit3
示例#21
0
    def OnRunSpecial3(self, g, t, a):
        def special_hit(g, s, a):
            #g.hud.show_dialog(_("\"It's stopped.\n\tI think that must have been a landslide,\nthe cave entrance looks closed off now.\n\tI'll just have to find another way out.\""));
            g.quake = 0
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit
示例#22
0
    def OnRunSpecial5(self, g, t, a):
        def special_hit5(g, s, a):
            self.hud.show_dialog(
                _("""A tree snake! Maybe you should climb that other vine."""))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit5
示例#23
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit(g, s, a):
            g.hud.add_pending_dialog(
                _("\"Well that looks like the exit, but the path's caved in!\n\tI pray I can find another way out...\""
                  ))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit
示例#24
0
    def OnRunSpecial2(self, g, t, a):
        def special_hit2(g, s, a):
            g.hud.add_pending_dialog(
                _("""\"Hrm. Maybe I should jump on that tree branch to the right so that I don't have to cross paths with this jaguar.\""""
                  ))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit2
示例#25
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit1(g, s, a):
            g.hud.add_pending_dialog(
                _("""Hint: This mound is too high for Dave to jump up to. Why don't you jump on the other mound to the left and then
\tjump on the tree branch and onto the mound from there?"""))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit1
示例#26
0
    def OnRunSpecial1(self, g, t, a):
        def special_hit1(g, s, a):
            g.quake = 5
            self.fallingBridge((1632, 640), 1)
            self.fallingBridge((1856, 576), 5)
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit1
示例#27
0
	def OnRunSpecial3(self, g, t, a):
		def special_hit(g, s, a):
			if (not g.cracked_branch):
				g.cracked_branch = 1
				g.hud.show_dialog(_("\"Uh oh! Dave has slipped!\""));
			s.agroups = None
		
		s = tilevid.Sprite(g.images['blank'],t.rect)
		g.sprites.append(s)
		s.agroups = g.string2groups('player')
		s.hit = special_hit
示例#28
0
    def OnRunSpecial2(self, g, t, a):
        def special_hit2(g, s, a):
            g.hud.add_pending_dialog(
                _("""\"What's that!? I thought all the jaguars left the jungle!
\tOh well, I hope it's the last one.\""""))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit2
示例#29
0
def player_new(g, t, value):
    g.clayer[t.ty][t.tx] = 0
    s = tilevid.Sprite(g.images['player'], t.rect)
    g.sprites.append(s)
    s.loop = player_loop
    s.groups = g.string2groups('player')
    s.score = 0
    g.player = s
    ##In player_new() I add the shoot handler.
    ##::
    s.shoot = player_shoot
示例#30
0
    def OnRunSpecial3(self, g, t, a):
        def special_hit3(g, s, a):
            self.disapearingBranch(g)
            self.hud.show_dialog(
                _("""*CRACK!* Oops! This branch wasn't strong enough to hold Dave!!"""
                  ))
            s.agroups = None

        s = tilevid.Sprite(g.images['blank'], t.rect)
        g.sprites.append(s)
        s.agroups = g.string2groups('player')
        s.hit = special_hit3