Control: 'WASD' + mouse
stanislavpetrovv / doom-style-game Goto Github PK
View Code? Open in Web Editor NEWDOOM-style 3D (raycasting) Game in Python Pygame
License: MIT License
DOOM-style 3D (raycasting) Game in Python Pygame
License: MIT License
Development on mac may result in the return of sprite images in the incorrect order. For example, your weapon may start off in the firing state and look strange when using it, or the animation of npc's may look odd. I propose using the natsort library to sort the animated sprite pngs. So add this to the requirements.txt:
natsort==8.2.0
and change
def get_images(self, path): images = deque() for file_name in os.listdir(path): if os.path.isfile(os.path.join(path, file_name)): img = pg.image.load(path + '/' + file_name).convert_alpha() images.append(img) return images
to:
def get_images(self, path): images = deque() file_names = natsorted(os.listdir(path)) for file_name in file_names: if os.path.isfile(os.path.join(path, file_name)): img = pg.image.load(f'{path}/{file_name}').convert_alpha() images.append(img) return images
but i'm open to any better alternatives.
It may also be the case that I'm the only one with this issue.
I am loving this tutorial on youtube and working my way through it
I have a really weird behaviour tho
in the 2d map and on the projection
when I move left and right its doesnt rotate, only moves the player horizontally or vertically ?
I just cant work out why ?
soo after the ray casting part i did everything as u did in the tutorial but this keeps on happening w me idk what i did wrong
and still i followed the tutorial will texturing but it aint working
![image](https://user-images.githubusercontent.com/77189096/206292592-345dccb9-c5dc-4cae-8599-
bb8a32899552.png)
i have error in this line, please help me
pg.display.set_caption(f'{self.clock.get_fps() :.1f}')
^
SyntaxError: invalid syntax
Hi, good job! The pygame lib needed a few fixes in order to run with my version (convert float to int):
It's here: https://github.com/Twenkid/Doom-Wolfenstein-PyGame/
Cheers!
Line 25 in 07b2ce3
While trying out object_renderer.py (around the the 20:15 mark in the video), I'll encounter an error, often when I turn at the same time I'm moving. I've even copy-pasted lines from the repo into my own copy and it still gives the same error. Here's the error text:
pygame 2.1.2 (SDL 2.0.18, Python 3.10.10)
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
Traceback (most recent call last):
File "/Users/tom/Desktop/Python/RaycastingGame/main.py", line 53, in <module>
game.run()
File "/Users/tom/Desktop/Python/RaycastingGame/main.py", line 47, in run
self.update()
File "/Users/tom/Desktop/Python/RaycastingGame/main.py", line 27, in update
self.raycasting.update()
File "/Users/tom/Desktop/Python/RaycastingGame/raycasting.py", line 111, in update
self.get_objects_to_render()
File "/Users/tom/Desktop/Python/RaycastingGame/raycasting.py", line 21, in get_objects_to_render
wall_column = pg.transform.scale(wall_column, (SCALE, proj_height))
ValueError: Cannot scale to negative size
I'm guessing involves some kind of math, but I wouldn't know where and how to begin to fix it. Any thoughts?
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
Traceback (most recent call last):
File "main.py", line 72, in
File "main.py", line 25, in init
File "main.py", line 30, in new_game
File "object_renderer.py", line 9, in init
self.wall_textures = self.load_wall_textures()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "object_renderer.py", line 59, in load_wall_textures
1: self.get_texture('resources/textures/1.png'),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "object_renderer.py", line 54, in get_texture
texture = pg.image.load(path).convert_alpha()
^^^^^^^^^^^^^^^^^^^
FileNotFoundError: No file 'resources/textures/1.png' found in working directory 'C:\Users\REDACTED\Desktop\DOOM-style-Game Output'.
I put the correct script location, the correct icon, i put all the correct directories and subdirectories, and also put all the other .py files in additional files section, and then converted it, but it gives the error above, like there is a file there????
help
When I was in college for my Bachelor degree 20 years ago in 2004 , for my final diploma project I have developed DOOM 4th Dimension game, very simple compare to this example, but still looks good, I wish I had this example back in 2004.
Here is gameplay of my DOOM 4D https://www.youtube.com/watch?v=G__Qhrms1fw
Also source code: https://github.com/adv4000/doom4d
Spasibo!
SO GOOD!!!
Plz make it so that it is not so sensitive plz?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.