NotQuiteParadise2

Animation

class Animation(frames: Dict[str, List[Image]], frame_duration: float = 0.6, loop: bool = True, starting_frame_set_name: str = None, uses_simulation_time: bool = True)[source]

Bases: object

Class to hold visual information for a series of images

__init__(frames: Dict[str, List[Image]], frame_duration: float = 0.6, loop: bool = True, starting_frame_set_name: str = None, uses_simulation_time: bool = True)[source]
property current_frame_set: List[Image]
flash(colour: Tuple[int, int, int], duration: float = 0.05)[source]

Change the colour of the sprite for a given period.

get_frame(frame_num: int) nqp.base_classes.image.Image[source]

Return the Image of the nth frame

property height: int
property image: nqp.base_classes.image.Image

Return the current frame.

property is_finished: bool

” Return True if this animation has finished playing.

pause()[source]

Pause the animation

play()[source]

Resume the animation

reset()[source]

Reset and pause the animation

set_current_frame_set_name(frame_set_name: str)[source]

Set the frame set to be used.

If the name given isnt a valid key no action is taken.

stop()[source]

Finish the animation

property surface: pygame.Surface

Return the current frame’s surface.

update(delta_time: float, game_speed: float)[source]
property width: int