Class: AnimationManager

AnimationManager


new AnimationManager()

This class will let you handle all of the sex scenes

Source:

Methods


<private> _initAnimations()

The game's animations. Use this as a template for your own animations

Source:

<private> _initGallery()

The game's gallery functions. Use this as a template for your own gallery conditions

Source:

addToGallery(callback)

Add a function that returns an array of AnimationManager.galleryObject

Parameters:
Name Type Description
callback function

Function must return an array

Source:

createAnimation(config)

Parameters:
Name Type Description
config AnimationManager.animationConfig
Source:
Examples
// 27 frame animation. QueenThroatdefault00000 to QueenThroatdefault00026
GAME.animation.createAnimation({
    ID: "QueenThroatdefault",
    frameRate: 24,
    frames: () => {
         GAME.animation.createFrames('QueenThroatdefault', 0, 26, 5);
    }
});
// Only one image in animation
GAME.animation.createAnimation({
    ID: "townFuckQuest3",
    frameRate: 1,
    frames: [{key: "townFuckQuest3"}]
}
// Only two images in animation
GAME.animation.createAnimation({
    ID: "forestBeastQuest1",
    frameRate: 1,
    frames: [{key: 'forestBeastQuest1'}, {key: 'forestBeastQuest2'}]
}

createFrames(animationID, start, stop [, pad])

Creates the frames array for the animation

Parameters:
Name Type Argument Default Description
animationID string
start number

The starting frame of the animation, usually 0

stop number

The stopping frame of the animation. For example QueenThroatdefault ends on frame 26

pad number <optional>
5

Padding is how many 0s there are in the picture files. For example QueenThroatdefault00001 has 5 padding.

Source:
Returns:
Type
Array

getAnimation(animationID)

Returns an animation object that Phaser can use

Parameters:
Name Type Description
animationID string
Source:
Returns:
Type
object

getBossAnimations(bossID)

Returns the animations used for a boss battle

Parameters:
Name Type Description
bossID string
Source:

getGallery()

Returns an array of available gallery animations

Source:
Returns:
Type
Array

playAnimation(animationID)

Launches the animation scene and plays the animation. Returns a promise so don't forget to resolve it

Parameters:
Name Type Description
animationID string
Source:
Returns:
Type
Promise.<any>

Type Definitions


animationConfig

You will notice I use "path", "fileType", and "bossBattle" in my configs. You can ignore those. Those properties will never be used by a modder.

Properties:
Name Type Description
ID string
frameRate number
frames function | array

Pass the createFrames function or a completed Phaser frames array into this parameter

Source:

galleryObject

Properties:
Name Type Description
thumbnail string

The texture key of the thumbnail that is going to be used in the gallery, usually the first frame of the animation

type 'Animation' | 'Image'

The type of animation. Either a still "Image" or an "Animation"

animationID string

The animation ID for playing the animation

Source: