Advertisement
ClearCode

Zelda copy/paste

Jan 23rd, 2022
15,719
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.81 KB | None | 1 0
  1. # level import dictionaries
  2. layouts = {
  3.             'boundary': import_csv_layout('../map/map_FloorBlocks.csv'),
  4.             'grass': import_csv_layout('../map/map_Grass.csv'),
  5.             'object': import_csv_layout('../map/map_Objects.csv'),
  6.             'entities': import_csv_layout('../map/map_Entities.csv')
  7.         }
  8.        
  9. graphics = {
  10.             'grass': import_folder('../graphics/Grass'),
  11.             'objects': import_folder('../graphics/objects')
  12.         }
  13.  
  14. # player stats
  15. self.stats = {'health': 100,'energy':60,'attack': 10,'magic': 4,'speed': 5}
  16. self.max_stats = {'health': 300, 'energy': 140, 'attack': 20, 'magic' : 10, 'speed': 10}
  17. self.upgrade_cost = {'health': 100, 'energy': 100, 'attack': 100, 'magic' : 100, 'speed': 100}
  18.  
  19. # enemy stats
  20. self.monster_name = monster_name
  21. monster_info = monster_data[self.monster_name]
  22. self.health = monster_info['health']
  23. self.exp = monster_info['exp']
  24. self.speed = monster_info['speed']
  25. self.attack_damage = monster_info['damage']
  26. self.resistance = monster_info['resistance']
  27. self.attack_radius = monster_info['attack_radius']
  28. self.notice_radius = monster_info['notice_radius']
  29. self.attack_type = monster_info['attack_type']
  30.  
  31. # game setup
  32. WIDTH    = 1280
  33. HEIGTH   = 720
  34. FPS      = 60
  35. TILESIZE = 64
  36. HITBOX_OFFSET = {
  37.     'player': -26,
  38.     'object': -40,
  39.     'grass': -10,
  40.     'invisible': 0}
  41.  
  42. # ui
  43. BAR_HEIGHT = 20
  44. HEALTH_BAR_WIDTH = 200
  45. ENERGY_BAR_WIDTH = 140
  46. ITEM_BOX_SIZE = 80
  47. UI_FONT = '../graphics/font/joystix.ttf'
  48. UI_FONT_SIZE = 18
  49.  
  50. # general colors
  51. WATER_COLOR = '#71ddee'
  52. UI_BG_COLOR = '#222222'
  53. UI_BORDER_COLOR = '#111111'
  54. TEXT_COLOR = '#EEEEEE'
  55.  
  56. # ui colors
  57. HEALTH_COLOR = 'red'
  58. ENERGY_COLOR = 'blue'
  59. UI_BORDER_COLOR_ACTIVE = 'gold'
  60.  
  61. # upgrade menu
  62. TEXT_COLOR_SELECTED = '#111111'
  63. BAR_COLOR = '#EEEEEE'
  64. BAR_COLOR_SELECTED = '#111111'
  65. UPGRADE_BG_COLOR_SELECTED = '#EEEEEE'
  66.  
  67. # weapons
  68. weapon_data = {
  69.     'sword': {'cooldown': 100, 'damage': 15,'graphic':'../graphics/weapons/sword/full.png'},
  70.     'lance': {'cooldown': 400, 'damage': 30,'graphic':'../graphics/weapons/lance/full.png'},
  71.     'axe': {'cooldown': 300, 'damage': 20, 'graphic':'../graphics/weapons/axe/full.png'},
  72.     'rapier':{'cooldown': 50, 'damage': 8, 'graphic':'../graphics/weapons/rapier/full.png'},
  73.     'sai':{'cooldown': 80, 'damage': 10, 'graphic':'../graphics/weapons/sai/full.png'}}
  74.  
  75. # magic
  76. magic_data = {
  77.     'flame': {'strength': 5,'cost': 20,'graphic':'../graphics/particles/flame/fire.png'},
  78.     'heal' : {'strength': 20,'cost': 10,'graphic':'../graphics/particles/heal/heal.png'}}
  79.  
  80. # enemy
  81. monster_data = {
  82.     'squid': {'health': 100,'exp':100,'damage':20,'attack_type': 'slash', 'attack_sound':'../audio/attack/slash.wav', 'speed': 3, 'resistance': 3, 'attack_radius': 80, 'notice_radius': 360},
  83.     'raccoon': {'health': 300,'exp':250,'damage':40,'attack_type': 'claw',  'attack_sound':'../audio/attack/claw.wav','speed': 2, 'resistance': 3, 'attack_radius': 120, 'notice_radius': 400},
  84.     'spirit': {'health': 100,'exp':110,'damage':8,'attack_type': 'thunder', 'attack_sound':'../audio/attack/fireball.wav', 'speed': 4, 'resistance': 3, 'attack_radius': 60, 'notice_radius': 350},
  85.     'bamboo': {'health': 70,'exp':120,'damage':6,'attack_type': 'leaf_attack', 'attack_sound':'../audio/attack/slash.wav', 'speed': 3, 'resistance': 3, 'attack_radius': 50, 'notice_radius': 300}}
  86.  
  87.  
  88. # particle dictionary
  89. self.frames = {
  90.             # magic
  91.             'flame': import_folder('../graphics/particles/flame/frames'),
  92.             'aura': import_folder('../graphics/particles/aura'),
  93.             'heal': import_folder('../graphics/particles/heal/frames'),
  94.            
  95.             # attacks
  96.             'claw': import_folder('../graphics/particles/claw'),
  97.             'slash': import_folder('../graphics/particles/slash'),
  98.             'sparkle': import_folder('../graphics/particles/sparkle'),
  99.             'leaf_attack': import_folder('../graphics/particles/leaf_attack'),
  100.             'thunder': import_folder('../graphics/particles/thunder'),
  101.  
  102.             # monster deaths
  103.             'squid': import_folder('../graphics/particles/smoke_orange'),
  104.             'raccoon': import_folder('../graphics/particles/raccoon'),
  105.             'spirit': import_folder('../graphics/particles/nova'),
  106.             'bamboo': import_folder('../graphics/particles/bamboo'),
  107.            
  108.             # leafs
  109.             'leaf': (
  110.                 import_folder('../graphics/particles/leaf1'),
  111.                 import_folder('../graphics/particles/leaf2'),
  112.                 import_folder('../graphics/particles/leaf3'),
  113.                 import_folder('../graphics/particles/leaf4'),
  114.                 import_folder('../graphics/particles/leaf5'),
  115.                 import_folder('../graphics/particles/leaf6'),
  116.                 self.reflect_images(import_folder('../graphics/particles/leaf1')),
  117.                 self.reflect_images(import_folder('../graphics/particles/leaf2')),
  118.                 self.reflect_images(import_folder('../graphics/particles/leaf3')),
  119.                 self.reflect_images(import_folder('../graphics/particles/leaf4')),
  120.                 self.reflect_images(import_folder('../graphics/particles/leaf5')),
  121.                 self.reflect_images(import_folder('../graphics/particles/leaf6'))
  122.                 )
  123.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement