All pastes #910752 Raw Edit

Miscellany

public text v1 · immutable
·published 2008-02-20 04:36 UTC
rendered paste body
def CurrentMap(self):
		
		#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))

		if Global.toprect.colliderect(Global.NarsisRect) == True and Global.Area == 0:
			Global.Area = Global.CurrentArea ["north"]
			print "loading area north"
			Global.NarsisY = 180 

		#if your north and you move south
		if Global.bottomrect.colliderect(Global.NarsisRect) == True and Global.Area == 1:
			Global.Area = Global.CurrentArea ["central"]
			print "loading area central"
			Global.NarsisY = 15
		
		#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))

		if Global.bottomrect.colliderect(Global.NarsisRect) == True and Global.Area == 0:
			Global.Area = Global.CurrentArea ["south"]
			print "loading area south"
			Global.NarsisY = 15

		#if your north and you move south
		if Global.toprect.colliderect(Global.NarsisRect) == True and Global.Area == 2:
			Global.Area = Global.CurrentArea ["central"]
			print "loading area central"
			Global.NarsisY = 180	
				
		#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))

		if Global.leftrect.colliderect(Global.NarsisRect) == True and Global.Area == 0:
			Global.Area = Global.CurrentArea ["west"]
			print "loading area west"
			Global.NarsisX = 270

		#if your north and you move south
		if Global.rightrect.colliderect(Global.NarsisRect) == True and Global.Area == 4:
			Global.Area = Global.CurrentArea ["central"]
			print "loading area central"
			Global.NarsisX = 15	
						
		#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))
		if Global.rightrect.colliderect(Global.NarsisRect) == True and Global.Area == 0:
			Global.Area = Global.CurrentArea ["east"]
			print "loading area east"
			Global.NarsisX = 15

		#if your north and you move south
		if Global.leftrect.colliderect(Global.NarsisRect) == True and Global.Area == 3:
			Global.Area = Global.CurrentArea ["central"]
			print "loading area central"
			Global.NarsisX = 270