mirror of
https://github.com/n0remac/game-jam-2020.git
synced 2025-12-09 22:05:19 -06:00
removed whitespace and other formatting.
This commit is contained in:
@@ -43,7 +43,6 @@ class Config(object):
|
||||
TOP_VIEWPORT_MARGIN = 100
|
||||
|
||||
|
||||
|
||||
class Enums(Enum):
|
||||
"""
|
||||
A simple class used for tracking different simple
|
||||
|
||||
@@ -11,9 +11,10 @@ import math
|
||||
from config import Config
|
||||
from map import Dungeon
|
||||
from mobs import Player, Enemy
|
||||
from config import Config, Sprites
|
||||
from config import Config
|
||||
from projectiles import Temp
|
||||
|
||||
|
||||
class Game(arcade.Window):
|
||||
"""
|
||||
Main application class.
|
||||
@@ -79,11 +80,10 @@ class Game(arcade.Window):
|
||||
self.dungeon.render()
|
||||
self.player.draw()
|
||||
self.enemy_list.draw()
|
||||
self.wall_list.draw()
|
||||
self.bullet_list.draw()
|
||||
|
||||
x, y = self.player.center_x, self.player.center_y + 100
|
||||
arcade.draw_text(f"({x}, {y})", x, y, arcade.color.WHITE, 15)
|
||||
# arcade.draw_text(f"({x}, {y})", x, y, arcade.color.WHITE, 15)
|
||||
|
||||
def on_key_press(self, key, modifiers):
|
||||
"""Called whenever a key is pressed. """
|
||||
@@ -128,8 +128,8 @@ class Game(arcade.Window):
|
||||
# Create a bullet TEMP SPRITE, currently wielding frog slingshot
|
||||
bullet = Temp()
|
||||
# Position the bullet at the player's current location
|
||||
start_x = self.player_list.center_x
|
||||
start_y = self.player_list.center_y
|
||||
start_x = self.player.center_x
|
||||
start_y = self.player.center_y
|
||||
bullet.center_x = start_x
|
||||
bullet.center_y = start_y
|
||||
|
||||
@@ -198,21 +198,21 @@ class Game(arcade.Window):
|
||||
self.view_bottom,
|
||||
Config.SCREEN_HEIGHT + self.view_bottom)
|
||||
|
||||
#Projectile updates
|
||||
# Projectile updates
|
||||
self.bullet_list.update()
|
||||
for bullet in self.bullet_list:
|
||||
# Collision Checks
|
||||
hit_list = arcade.check_for_collision_with_list(bullet, self.wall_list)
|
||||
hit_list = arcade.check_for_collision_with_list(bullet, self.dungeon.getWalls())
|
||||
|
||||
# If it did, get rid of the bullet
|
||||
if len(hit_list) > 0:
|
||||
bullet.remove_from_sprite_lists()
|
||||
|
||||
# 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:
|
||||
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()
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""
|
||||
Setups up window classes and runs the game.
|
||||
|
||||
@@ -5,8 +5,6 @@ Organizes classes related to projectiles
|
||||
|
||||
import arcade
|
||||
|
||||
from config import Config, Sprites
|
||||
|
||||
|
||||
class Projectile(arcade.Sprite):
|
||||
"""
|
||||
@@ -17,9 +15,9 @@ class Projectile(arcade.Sprite):
|
||||
super().__init__()
|
||||
|
||||
self.speed = speed
|
||||
self.damage = damage #unimplemented
|
||||
self.damage = damage # unimplemented
|
||||
self.texture = None
|
||||
self.range = range #unimplemented
|
||||
self.range = range # unimplemented
|
||||
self.collision_list = []
|
||||
|
||||
|
||||
@@ -31,7 +29,7 @@ class Temp(Projectile):
|
||||
super(Temp, self).__init__(*args, **kwargs)
|
||||
self.texture = arcade.load_texture("resources/images/monsters/frog/frog1.png")
|
||||
self.speed = 12
|
||||
self.scale = 2
|
||||
#collision list for who/what to collide with: wall, player, enemy
|
||||
self.scale = 4
|
||||
# collision list for who/what to collide with: wall, player, enemy
|
||||
|
||||
#Can place function for starting on player or enemy
|
||||
# Can place function for starting on player or enemy
|
||||
|
||||
Reference in New Issue
Block a user