Giter Site home page Giter Site logo

red_invaders's People

Contributors

akapkotel avatar dependabot[bot] avatar

Watchers

 avatar

red_invaders's Issues

Rocket seing more than 1 possible target

Rockets launched by the player can detect only the one - closest to the player - hostile ship from game.hostiles SpriteList. If 2 or more rockets are launched, each would target the same enemy, if it is still the closest hostile, since there is no method of excluding targetted Sprites from being targetted.

This is how rockets targetting algorithm looks like:

    def rocket_autoaim(self):
        """
        Method used only by 'rockets'. They make turns towards enemies.
        """
        # acquire target if has any and there are possible targets
        if not self.target and len(game.hostiles) > 0:
            if self.angle == UPWARD:  # if rocket fired by player
                # TODO: rockets ignoring targets already acquired by other
                #  rockets and take next one [ ][ ], test it [ ]
                # closest enemy ship:
                self.target = arcade.get_closest_sprite(self, game.hostiles)[0]
            else:
                self.target = game.player

The problem is, that method get_closest_sprite() of arcade.SpriteList accepts only the SpriteList, and not the list as the second argument. Creating another SpriteList for that purpose would be an
overkill.

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.