akapkotel / red_invaders Goto Github PK
View Code? Open in Web Editor NEWSimple arcade space-shooter game made in Python3.6 with Arcade2.0.8 library.
License: Other
Simple arcade space-shooter game made in Python3.6 with Arcade2.0.8 library.
License: Other
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.
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.