def test_artist_draw_origin(self):
block = pygame.surface.Surface((2, 2))
block.fill((255, 0, 0), pygame.Rect(0, 0, 2, 2))
ps = particle.ParticleSystem(
particle.Particle(0, 1, 1, 0, 3, 'pixel'),
particle.EmitterBurst.single(1),
artist=particle.ArtistSimple(block, (0, 0)),
)
world = pygame.surface.Surface((4, 4))
world.fill((0, 255, 0), pygame.Rect(0, 0, 4, 4))
desired_world = pygame.surface.Surface((4, 4))
desired_world.fill((0, 255, 0), pygame.Rect(0, 0, 4, 4))
for x in (1, 2):
for y in (1, 2):
desired_world.set_at((x, y), (255, 0, 0))
ps.update_state(1)
ps.draw_on(world)
assert(compare_surfaces(desired_world, world))
评论列表
文章目录