Example #1
0
import maps
import text
import ai
import damage

''' time keeping '''
clock = pygame.time.Clock()

''' rectangles and rectangeloids '''
camera = pygame.rect.Rect(0, 0, sizeX, sizeY)
darkness = pygame.rect.Rect(0, 0, sizeX, sizeY)
night = pygame.Surface((sizeX, sizeY))
night.set_alpha(128)  
night.fill((0,0,24))      

map = maps.spawn('sail')

''' text '''
message = []
pygame.font.init
font = {'family': pygame.font.match_font('verdana'), 'color': (255,255,255), 'size': 16}
dialogue = pygame.font.Font(font['family'], font['size'])
message.append(None)
messageNo = 0
textRecovRate = 100
textRecov = textRecovRate

''' hud text '''
herbCount = 0
hudfont = {'family': pygame.font.match_font('verdana'), 'color': (255,255,255), 'size': 11}
hudtxt = pygame.font.Font(hudfont['family'], hudfont['size'])
Example #2
0
#!/usr/bin/env python

''' standard '''
import pygame, random, sys
from pygame.locals import *
pygame.init()

''' engine files '''
import maps

map = maps.spawn('plain')

''' config '''
sizeX = 1360
sizeY = 800
''' window title '''
pygame.display.set_caption("Beowulf")
''' window dimensions '''
screen = pygame.display.set_mode((sizeX, sizeY), 0, 32)

''' images used '''
playerfile = "beo-overworld-front.png"

''' convert images for pygame '''
grass = {
	'grass1': pygame.image.load("tiles/grass1.png").convert(),
	'grass2': pygame.image.load("tiles/grass2.png").convert(),
	'grass3': pygame.image.load("tiles/grass3.png").convert(),
	'grass4': pygame.image.load("tiles/grass4.png").convert(),
}
player = pygame.image.load(playerfile).convert_alpha()