screen-projectile deletion fix, comment updates to note TEMP features

This commit is contained in:
Lief9100
2020-04-20 01:47:48 -07:00
committed by Cameron Smart
parent 3034d96ab7
commit b06fcaf0f8
2 changed files with 4 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ class Config(object):
BOTTOM_VIEWPORT_MARGIN = 50
TOP_VIEWPORT_MARGIN = 100
#Bullet constants
#Bullet constants TEMP change to speed factor in projectiles.py
BULLET_SPEED = 5

View File

@@ -124,7 +124,7 @@ class Game(arcade.Window):
"""
Called whenever the mouse is clicked.
"""
# Create a bullet NEED SPRITE, currently wielding frog slingshot
# Create a bullet TEMP SPRITE, currently wielding frog slingshot
bullet = arcade.Sprite("resources/images/monsters/frog/frog1.png", Config.BULLET_SCALING)
# Position the bullet at the player's current location
@@ -208,8 +208,8 @@ class Game(arcade.Window):
if len(hit_list) > 0:
bullet.remove_from_sprite_lists()
# If the bullet flies off-screen, remove it.
if bullet.bottom > self.width or bullet.top < 0 or bullet.right < 0 or bullet.left > self.width:
# If the bullet flies off-screen, remove it. TEMP change to range calc
if bullet.bottom < self.view_bottom or bullet.top > self.view_bottom+Config.SCREEN_HEIGHT or bullet.right > self.view_left+Config.SCREEN_WIDTH or bullet.left < self.view_left:
bullet.remove_from_sprite_lists()