All pastes #910789 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-20 05:23 UTC
rendered paste body
def CurrentMap(self):

    areas = { "central": 0,
              "north": 1,
              "south": 2,
              "east": 3,
              "west": 4
            }
		
	#draw the boundariesand check for collision to change areas
	#currentarea 1 is the north area of the current zone
	Global.screen.blit(Global.top,(0,0))
	Global.toprect.topleft = (0,0)
	Global.top.set_colorkey((255,255,255))

	#currentarea 2 is the south area of the current zone
	Global.screen.blit(Global.bottom,(0,230))
	Global.bottomrect.topleft = (0,230)
	Global.bottom.set_colorkey((255,255,255))

	#currentarea 4 is the west area of the current zone
	Global.screen.blit(Global.left,(0,0))
	Global.leftrect.topleft = (0,0)
	Global.left.set_colorkey((255,255,255))

	#currentarea 3 is the east area of the current zone	
	Global.screen.blit(Global.right,(310,0))
	Global.rightrect.topleft = (310,0)
	Global.right.set_colorkey((255,255,255))

    # Are we moving from CENTRAL...
	if (Global.Area == areas["central"]):

        # ... to the TOP?
        if (Global.toprect.colliderect(Global.NarsisRect) == True):
    		Global.Area = Global.CurrentArea ["north"]
    		print "Moving from Central to North"
    		Global.NarsisY = 180

        # ... to the BOTTOM?
        if (Global.bottomrect.colliderect(Global.NarsisRect) == True):
		    Global.Area = Global.CurrentArea ["south"]
    		print "loading area south"
    		Global.NarsisY = 15

        # ... to the LEFT?
    	if (Global.leftrect.colliderect(Global.NarsisRect) == True):
	    	Global.Area = Global.CurrentArea ["west"]
    		print "loading area west"
    		Global.NarsisX = 270

        # ... to the RIGHT?
	    if Global.rightrect.colliderect(Global.NarsisRect) == True and Global.Area == 0:
    		Global.Area = Global.CurrentArea ["east"]
    		print "loading area east"
    		Global.NarsisX = 15

    # Are we moving from the NORTH...
    elif (Global.Area == areas["north"]):

        # ... to the BOTTOM?
    	if (Global.bottomrect.colliderect(Global.NarsisRect) == True):
    		Global.Area = Global.CurrentArea ["central"]
    		print "loading area central"
    		Global.NarsisY = 15

    # Are we moving from the SOUTH...
	elif (Global.Area == areas["south"]):

        # ... to the TOP?
        if (Global.toprect.colliderect(Global.NarsisRect) == True):
    		Global.Area = Global.CurrentArea ["central"]
    		print "loading area central"
    		Global.NarsisY = 180

    # Are we moving from the WEST... 
    elif (Global.Area == areas["west"]):

        # ... to the RIGHT?
        if (Global.rightrect.colliderect(Global.NarsisRect) == True):
    		Global.Area = Global.CurrentArea ["central"]
    		print "loading area central"
    		Global.NarsisX = 15

	# Are we moving from the EAST...
    elif (Global.Area == areas["east"]):

        # ... to the LEFT?
    	if (Global.leftrect.colliderect(Global.NarsisRect) == True):
    		Global.Area = Global.CurrentArea ["central"]
    		print "loading area central"
    		Global.NarsisX = 270