python - Argument not being taken from class? -


I hope that when I grow up I'm trying to create a class to make my program easier. I have a class tilemap, which makes a pajama phantom. I try to call this phantom, then I'll blow it up. But when I do this, it claims that it is not a surface but instead it says that it is a tilemap class. Error:

  Traceback (most recent call final): File "F: \ Desktop Files \ Python \ Pigme RPG Type Game \ RPG Test 2.p", in line 166,  

player = player (placeplayer) grassstyle = tilemap (spacegrower) waterlet = tilemap (location) waterbeak = tilemap (space-bit) TILE_WIDTH = 32 TILE_HEIGHT = 32 Tilemap = [[Grassstyle, Grassstyle, Grassstyle, Grassstyle, Waterbeek, Waterlit, Watertate, Watertile, watertile], [grasstile, grasstile, grasstile, grasstile, Waterbeach, watertile, watertile, wate rtile, watertile], [grasstile, grasstile, grasstile, grasstile, waterbeach, watertile, watertile, watertile, watertile], [watertile, watertile, waterlet, watertale, watertale, waterlab, watertale, watertable, watertable]] total_leavl_width = [0]) * 32 total_level_height = lane (tilemap) * 32 camera = camera (Simple_camera, total_level_width, total_level_height) map_surface = pygame.Surface ((lane (tilemap [0]) * TILE_WIDTH, lane (tilemap) * TILE_HEIGHT)) For, calculate the (tilemap) row: For x, tile_surface in the calculation of (line): map_surface.blit (tile_surface, (x * TILE_WIDTH, Y * TILE_HEIGHT)) map_surface = pygame.transform.scale (map_surface , (1200, 800))

class:

  class tilemap (pygame.sprite.Sprite): def __init __ (auto, fileloc): pygame .sprite.Sprite .__ init __ (self) self.image = pygame.image.load (fileloc) .convert () self.image.set_colorkey (WHITE) self.rect = self.image.get_rect ()   

Thank you for your time in answering this, and please note that I am quite new to Pygame, and this code is

* TILE_HEIGHT)

takes pygame.Surface as the first argument, when you enter tile_surface , which is a Example of tilemap .

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -