In the tag I'm active on I've seen an user post 10 questions the last 4 days and 8 of these questions are all the same format "I have this problem, here's my code: *code dump*. Basically using Stackoverflow as a debugging service. I don't know if I should go in and downvote all those questions, risking being flagged as a serial downvoter (I've downvoted some though).
I wanted to write a comment to the user but don't know how to explain why these questions aren't appreciated when most of them have upvotes and upvoted answers. That also makes me a bit skeptical; maybe I am wrong? I know all questions could be closed since it must contain "the shortest code necessary to reproduce it in the question itself", but I've seen many taking lightly at that point.
What should I do? (i.e. ignore it, downvote, send comment, realise I'm wrong, etc).
I don't know if I should link to this user's question, so I'll include the questions here for anonymity. After each question it should follow a code dump on average 100 lines, which I've excluded.
Question 1
I'm working on a space shooter game and In that game, when an alien sprite collides with a player sprite, I want the game to end. When wrote the code for the collision, It didn't end the game. Can someone help me?'
Question 2
I'm working on a space shooter and I've made the sprites and added some basic collision detection, but when I added in collision detection for whether or not an alien sprite collides with the player sprite, it gave me this error message:
Traceback (most recent call last): File "main.py", line 93, in game.new() File "main.py", line 33, in new self.run() File "main.py", line 45, in run self.collision() File "main.py", line 58, in collision hits = pygame.sprite.spritecollide(self.player, self.alien, False) File "C:\Users\sidna\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pygame\sprite.py", line 1525, in spritecollide return [s for s in group if spritecollide(s.rect)] TypeError: 'Alien' object is not iterable
Question 3
I'm working on a game, and In this game I need a yellow rectangle to show up on the game window, but when I ran the code the yellow rectangle didn't show up. I'm drawing the rectangle in the Player() class. Can anyone help me?
Question 4
I'm working on a game and In this game the player wins if its character (a ball) has a w of 34. I made a win screen, but when I tested it out, it was giving me an error message:
Traceback (most recent call last): File "main.py", line 260, in main() File "main.py", line 165, in main gameLoop() File "main.py", line 192, in gameLoop player.end() File "main.py", line 133, in end win() TypeError: 'Text' object is not callable
Question 5
I'm making The Snake Game, and in this game, when the snake hits a piece of food, the length of the snake increase. The issue that I'm having is that when I implemented some code that will help me make the snake's length longer and tested it out, the snake was moving behind the scenes but wasn't showing up. I know I have to update the display, but I don't know where.
Question 6
I'm working in a game, and in this game an object falls from the top of the game screen and the player at the bottom of the screen has to hit the object falling. When the player hits the falling object, the player's width and height needs to increase. When I tested the code, the collision worked when the player hit the falling object from the side, but the collision didn't work when the player hit the falling object in the middle. Can someone help me?
Question 7
I'm working on a game, and In this game I have an object that falls from the top of the game screen. When the object's y >= 200, I want the object to redraw with a random x position. I tried to code it, but it doesn't work. I suspect there's some issue with where I'm redrawing the object. Can someone point out my mistake? The issue is in the draw()
Question 8
I'm working on a game, and in that game whenever the player's x is >= the screen's width, I want the player's x velocity to = 0. But when I tried, it didn't work. The collision code looks fine to me, I think there is some issue with when I call player.collision(). PS. The object's velocity is equal to 0 when the objects x is <= 0, but not when the x is >= displayW the velocity doesn't equal to 0. The problem is under #collision to walls