StanislavPetrovV / DOOM-style-Game

DOOM-style 3D (raycasting) Game in Python Pygame
MIT License
550 stars 242 forks source link

integer argument expected got float #1

Open martijnhiemstra opened 1 year ago

martijnhiemstra commented 1 year ago

On starting of main.py I get the error:

pygame 1.9.6
Hello from the pygame community. https://www.pygame.org/contribute.html
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
Traceback (most recent call last):
  File "main.py", line 72, in <module>
    game = Game()
  File "main.py", line 25, in __init__
    self.new_game()
  File "main.py", line 33, in new_game
    self.weapon = Weapon(self)
  File "/tmp/DOOM-style-Game/weapon.py", line 8, in __init__
    [pg.transform.smoothscale(img, (self.image.get_width() * scale, self.image.get_height() * scale))
  File "/tmp/DOOM-style-Game/weapon.py", line 8, in <listcomp>
    [pg.transform.smoothscale(img, (self.image.get_width() * scale, self.image.get_height() * scale))
TypeError: integer argument expected, got float
StanislavPetrovV commented 1 year ago

What version of Pygame? Make sure you have version 2.x.x Or try this (weapon.py): Untitled

init-chaos commented 1 year ago

pygame 2.1.2 (SDL 2.0.18, Python 3.7.6) Hello from the pygame community. https://www.pygame.org/contribute.html libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: cHRM chunk does not match sRGB libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile libpng warning: iCCP: known incorrect sRGB profile Traceback (most recent call last): File "main.py", line 72, in game = Game() File "main.py", line 25, in init self.new_game() File "main.py", line 32, in new_game self.object_handler = ObjectHandler(self) File "/Users/User/Dev/Doom/object_handler.py", line 23, in init self.spawn_npc() File "/Users/User/Dev/Doom/object_handler.py", line 65, in spawn_npc self.add_npc(npc(self.game, pos=(x + 0.5, y + 0.5))) File "/Users/User/Dev/Doom/npc.py", line 190, in init super().init(game, path, pos, scale, shift, animation_time) File "/Users/User/Dev/Doom/npc.py", line 8, in init super().init(game, path, pos, scale, shift, animation_time) File "/Users/User/Dev/Doom/sprite_object.py", line 62, in init self.images = self.get_images(self.path) File "/Users/User/Dev/Doom/sprite_object.py", line 87, in get_images img = pg.image.load(path + '/' + file_name).convert_alpha() pygame.error: Unsupported image format