diff options
author | Viljami Ilola <+@hix.fi> | 2024-03-30 12:07:49 +0200 |
---|---|---|
committer | Viljami Ilola <+@hix.fi> | 2024-03-30 12:07:49 +0200 |
commit | 607c00bc57fb68572754404cb5da0e7f7a5618e5 (patch) | |
tree | 195f10e6506a1c30500662230c807dc2756431af /tests/test_enemies.py | |
parent | 51c495d9691d19b65b377d377599ce1d52def874 (diff) |
refactor enemies to add bounchers
Diffstat (limited to 'tests/test_enemies.py')
-rw-r--r-- | tests/test_enemies.py | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/tests/test_enemies.py b/tests/test_enemies.py index 315de88..ed114ae 100644 --- a/tests/test_enemies.py +++ b/tests/test_enemies.py @@ -1,19 +1,28 @@ import os import unittest +import pygame from pathlib import Path -from enemies.enemies import EnemySprite, Enemies +from enemies.enemies import EnemyBall, Enemies +from display import Scaling from text import Fonts -class TestEnemySprite(unittest.TestCase): +class TestEnemyBall(unittest.TestCase): + def setUp(self): + Fonts.load_fonts(os.path.join( + Path(__file__).parent.parent.resolve(), + "src", + "sliceitoff")) + def test_can_create(self): - enemy = EnemySprite() + enemy = EnemyBall() self.assertNotEqual(None, enemy) class TestEnemies(unittest.TestCase): def setUp(self): + Scaling.update_scaling((640,400)) Fonts.load_fonts(os.path.join( Path(__file__).parent.parent.resolve(), "src", @@ -30,4 +39,9 @@ class TestEnemies(unittest.TestCase): def test_update_notcrashing(self): enemies = Enemies(count = 6) for _ in range(10000): - enemies.update(dt=100) + enemies.update( + dt=100, + field_rects=[ + Scaling.active, + pygame.Rect(800,0,200,200) + ]) |