MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/badcode/comments/mhbe5e/it_should_have_been_a_code_not_an_article/gsxvrrt/
r/badcode • u/[deleted] • Mar 31 '21
71 comments sorted by
View all comments
102
Image Transcription: Code
if entity.components.get("SPRITE_RENDERER_COMPONENT") and entity.components.get("TITLE_COMPONENT") is None: self.entity.components["SPRITE_RENDERER_COMPONENT"].rect.topleft - entity.components["SPRITE_RENDERER_COMPONENT"].rect.topleft self.entity.components["SPRITE_RENDERER_COMPONENT"].image - pygame.transform.scale(entity.components["SPRITE_RENDERER_COMPONENT"].image, (entity if self.entity.components.get("SPRITE_RENDERER_COMPONENT").color: self.entity.components["SPRITE_RENDERER_COMPONENT"].image.fill(self.entity.components["SPRITE_RENDERER_COMPONENT"].color) if self.entity.components.get("SPRITE_RENDERER_COMPONENT").opacity : self.entity.components["SPRITE_RENDERER_COMPONENT"].image.set_alpha(self.entity.components["SPRITE_RENDERER_COMPONENT"].opacity) if self.entity.components["SPRITE_RENDERER_COMPONENT"].renderable: self.app.screen.blit(self.entity.components["SPRITE_RENDERER_COMPONENT"].image, self.entity.components["SPRITE_RENDERER_COMPONENT"].rect) # if entity.components.get("LIGHTING_COMPONENT"): # self.app.filter.components["CANVAS_COMPONENT"].image.blit(self.entity.components["LIGHTING_COMPONENT"].light_bg_1, self.entity.compone if self.entity.components.get("SPRITE_RENDERER_COMPONENT").opacity: self.entity.components["SPRITE_RENDERER_COMPONENT"].image.set_alpha(self.entity.components["SPRITE_RENDERER_COMPONENT"].opacity) if entity.components.get("TILE_COMPONENT"): self.app.screen.blit( self.entity.components["SPRITE_RENDERER_COMPONENT"].image, ( self.entity.components["SPRITE_RENDERER_COMPONENT"].rect.x, self.entity.components["SPRITE_RENDERER_COMPONENT"].rect.y ), ( -self.entity.components["SPRITE_RENDERER_COMPONENT"].rect.x + self.camera_entity.components["CAMERA_COMPONENT"].camera_position[0], -self.entity.components["SPRITE_RENDERER_COMPONENT"].rect.y + self.camera_entity.components["CAMERA_COMPONENT"].camera_position[1], -self.camera_entity.components["CAMERA_COMPONENT"].camera_position[0] + self.app.window_w * 2, -self.camera_entity.components["CAMERA_COMPONENT"].camera_position[1] + self.app.window_h * 2, ) )
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!
29 u/Dehast Mar 31 '21 Already looks so much better 37 u/MatthewRPG576 Mar 31 '21 Good human 18 u/mrheosuper Mar 31 '21 Damn i love you. 10 u/knightttime Mar 31 '21 Lol, you're welcome! 23 u/hoyohoyo9 Mar 31 '21 ctrl+c "self.entity.components["SPRITE_RENDERER_COMPONENT"]"ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v 19 u/knightttime Mar 31 '21 how did you know? XD 5 u/edoCgiB Apr 01 '21 That's how the person who wrote the code did it. We've all been there :)))
29
Already looks so much better
37
Good human
18
Damn i love you.
10 u/knightttime Mar 31 '21 Lol, you're welcome!
10
Lol, you're welcome!
23
ctrl+c "self.entity.components["SPRITE_RENDERER_COMPONENT"]"
ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v ctrl+v
19 u/knightttime Mar 31 '21 how did you know? XD 5 u/edoCgiB Apr 01 '21 That's how the person who wrote the code did it. We've all been there :)))
19
how did you know? XD
5 u/edoCgiB Apr 01 '21 That's how the person who wrote the code did it. We've all been there :)))
5
That's how the person who wrote the code did it. We've all been there :)))
102
u/knightttime Mar 31 '21
Image Transcription: Code
I'm a human volunteer content transcriber for Reddit and you could be too! If you'd like more information on what we do and why we do it, click here!