All pastes #909904 Raw Edit

Untitled

public text v1 · immutable
·published 2008-02-19 16:41 UTC
rendered paste body
#########################################################
#Module to control the local zone and part of zone	# 
#Written by Derek Mcdonald				#
#########################################################
import pygame, os, sys , Global
from pygame.locals import *

#to controll which zone you are in and which area of that zone
class ZoneControll():
	
	def CurrentZone(self):
		if Global.CurrentZone == "SterlingField":
			Global.MapData = os.path.join (Global.CurrentZone,Global.SterlingField[Global.CurrentArea])
			Global.MapImage = pygame.image.load(Global.MapData).convert_alpha()
			#draw the map
			Global.screen.blit(Global.MapImage,(0,0))
			
	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.CurrentArea == 0:
			Global.CurrentArea = 1
			print "loading area north"
			Global.NarsisY = 180 
		
		#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.CurrentArea == 0:
			Global.CurrentArea = 2
			print "loading area south"
			Global.NarsisY = 15
				
		#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.CurrentArea == 0:
			Global.CurrentArea = 4
			print "loading area west"
			Global.NarsisX = 290
						
		#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:
			Global.CurrentArea = 3
			print "loading area east"