Giter VIP home page Giter VIP logo

space-shooter's People

Contributors

95ych avatar burned42 avatar deepsource-autofix[bot] avatar deepsourcebot avatar dependabot[bot] avatar desai10 avatar eduardbaer avatar imgbotapp avatar j-tesla avatar restyled-commits avatar restyled-io[bot] avatar thomaschr avatar vivekashok1221 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

space-shooter's Issues

(PYL-R1714) Consider using `in`

Description

To check if a variable is equal to one of many values, combine the values into a tuple and check if the variable is contained in it instead of checking for equality against each of the values. This is faster, less verbose, and more readable. <!--more--> ## Examples ### Bad …

Occurrences

There are 3 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/j-tesla/space-shooter/issue/PYL-R1714/occurrences/

[bug] local variable 'click' referenced before assignment

I have encountered a bug at the launch of the program where I get the following error and the program stops.

Traceback (most recent call last):
  File "main.py", line 571, in <module>
    main_menu()
  File "main.py", line 59, in main_menu
    if click:
UnboundLocalError: local variable 'click' referenced before assignment

This can be reproduced by putting the mouse pointer in the region of play or instructions button and then running the program.
Since collidepoint() will return True, the conditional statement inside gets executed.

This bug can be fixed by either moving click = False higher up or by rewriting the program and putting the event loop further down or putting the collidepoint() check inside the event of MOUSEBUTTONDOWN

The first way is easiest, however I feel the third method is "correct" way of doing it because:

  1. there need not be checking whether the mouse is in the region of play or instructions button at that point in the program, and
  2. it will lead to the elimination of the variable click

Save highscores

For starters, can store 'the highscore' in a txt file (or a json file). Can be updated if required after each game.

Add mouse control feature.

Hello, though i am new, still i have made little changes,like ability to shoot with the left mouse click and also while using mouse as refrence for x coordinate of player it proved much fun for me
Tried to fix this issue but couldn't.
If you would like to merge the changes that i mentioned above, then i could make a pull request.........

Originally posted by @AshAman999 in #15 (comment)

Asteroids disappearing on collision with immune ship

Asteroids shouldn't disappear when they hit the ship just after it spawns. They need to pass through the ship. Previous updated (#18) managed to prevent the explosion and health reduction. (#15)

        hits = pygame.sprite.spritecollide(player, mobs, True,
                                           pygame.sprite.collide_circle)

The True in there is causing this. Figure out a way to make it False without changing causing any effects.

add Back To Menu after game over

Currently the only action that can be done at the GAMEOVER screen is to close the window.
I would like to implement a "Back to Menu" and maybe even an "Play Again" button.

It would be highly appreciated if this issue can be assigned to me as I have already started working on it.

(PTC-W0048) `if` statements can be merged

Description

Nested if statements can be collapsed into a single if statement by separating their condition using and operator. Merging collapsible if statements increases the code's readability. ### Not preferred: python if condition1: if condition2: dosomething() ### Preferred: python if condition1 and condition2: dosomething()

Occurrences

There are 5 occurrences of this issue in the repository.

See all occurrences on DeepSource → deepsource.io/gh/j-tesla/space-shooter/issue/PTC-W0048/occurrences/

Add Menu

Instead of directly starting the game on start, add a menu.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.