parent
0927040d8d
commit
2843336d64
9 changed files with 8 additions and 22 deletions
@ -1,7 +1,6 @@ |
|||||||
import pygame as pg |
import pygame as pg |
||||||
from sprite import Sprite |
|
||||||
from random import randint |
from random import randint |
||||||
|
from .sprite import Sprite |
||||||
|
|
||||||
class Asteroid(Sprite): |
class Asteroid(Sprite): |
||||||
COOLTIME = 15 |
COOLTIME = 15 |
@ -1,6 +1,5 @@ |
|||||||
import pygame as pg |
import pygame as pg |
||||||
from sprite import Sprite |
from .sprite import Sprite |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Ship(Sprite): |
class Ship(Sprite): |
@ -1,5 +1,5 @@ |
|||||||
import pygame as pg |
import pygame as pg |
||||||
from sprite import Sprite |
from .sprite import Sprite |
||||||
|
|
||||||
SPEED = 6 |
SPEED = 6 |
||||||
COLOR = (255,0,0) |
COLOR = (255,0,0) |
@ -1,12 +0,0 @@ |
|||||||
import pygame as pg |
|
||||||
import pytest |
|
||||||
from ship import Ship |
|
||||||
|
|
||||||
def test_ship_constructor(): |
|
||||||
scr_rect = pg.Rect(0,0,100,100) |
|
||||||
a_ship = Ship((10+Ship.SIZE/2, 20+Ship.SIZE/2), scr_rect) |
|
||||||
assert a_ship.rect.centerx == scr_rect.centerx |
|
||||||
assert a_ship.rect.centery == scr_rect.centery |
|
||||||
assert a_ship.map_rect.left == 10+1 |
|
||||||
assert a_ship.map_rect.top == 20+1 |
|
||||||
|
|
Loading…
Reference in new issue