Created
November 19, 2011 20:39
-
-
Save orlp/1379322 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| from __future__ import division, print_function | |
| import function | |
| import pygame | |
| class Map(object): | |
| def __init__(self, game, mapname): | |
| self.mapname = mapname | |
| self.image = function.load_image("maps/" + mapname) | |
| self.image = pygame.transform.scale(self.image, (self.image.get_width()*6, self.image.get_height()*6)) | |
| self.image.set_colorkey(None) | |
| self.image = self.image.convert() | |
| self.collision_mask = function.load_mask("collisionmaps/" + mapname) | |
| x, y = self.collision_mask.get_size() | |
| self.collision_mask = self.collision_mask.scale(x*6, y*6) | |
| def draw(self, game): | |
| game.window.blit(self.image, (0, 0), (game.xview, game.yview, game.view_width, game.view_height)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment