Game

Contains all core game functions and classes

Classes

Achievement
Object
Upgrade

Namespaces

ModAPI
darkchoccupcake
devileye
goldencupcake
tooltip

Members

(static) Achievements :Object

All registred achievements

Type:
  • Object

(static) AchievementsById :Array.<Game.Achievement>

All registred achievements (Array)

Type:

(static) AchievementsOwned :number

Count of owned achievements

Type:
  • number

(static) BuildingsOwned :Object

All registred objects

Type:
  • Object

(static) CFell :boolean

Cupcake Fall flag

Type:
  • boolean

(static) ClickMastery :number

Current click mastery

Type:
  • number

(static) ClickMasteryStr :string

Click mastery string

Type:
  • string

(static) ClickRank :string

Click rank string

Type:
  • string

(static) CosmicCollapse :number

Cosmic collapse unlock flag

Type:
  • number

(static) CustomLogs :string

Custom string in Logs section

Type:
  • string

(static) CustomMenu :string

Custom string in Menu section

Type:
  • string

(static) CustomMods :string

Custom string in Mods section

Type:
  • string

(static) CustomStats :string

Custom string in Stats section

Type:
  • string

(static) DEV :boolean

Dev mode flag

Type:
  • boolean

(static) Kitten :boolean

Kitten mode flag

Type:
  • boolean

(static) Marhmall :boolean

Marshmallow mode flag

Type:
  • boolean

(static) Needto :number

Target for new click mastery rank

Type:
  • number

(static) Objects :Object

All registred objects

Type:
  • Object

(static) ObjectsById :Array.<Game.Object>

All registred objects (Array)

Type:

(static) T :number

Ticker varible

Type:
  • number

(static) Ticker :string

Current news label

Type:
  • string

(static) TickerAge :number

Current life of ticker

Type:
  • number

(static) Upgrades :Array.<Game.Object>

All registred upgrades

Type:

(static) UpgradesById :Array.<Game.Object>

All registred upgrades (Array)

Type:

(static) UpgradesOwned :number

How much upgrades user owns

Type:
  • number

(static) backgroundType :number

Custom background : 0=blue, 1=red...

Type:
  • number

(static) beta :number

Indicates, if game is in beta

Type:
  • number

(static) bg :string

Background image (bakers and such)

Type:
  • string

(static) bgFade :string

Fading to background

Type:
  • string

(static) bgR :number

Background ratio (0 - not faded, 1 - fully faded)

Type:
  • number

(static) bgRd :number

Background ratio displayed

Type:
  • number

(static) bigcupcakeDiv :HTMLElement

Cupcake sprite div

Type:
  • HTMLElement

(static) bincup :number

Binary cupcake unlock flag

Type:
  • number

(static) clickFrenzy :number

Click frenzy flag, as long as >0, mouse clicks get 777x more cupcakes

Type:
  • number

(static) coffeeDiv :HTMLElement

Coffee sprite div

Type:
  • HTMLElement

(static) coffeeH :number

Coffee height, between 0 and 1 (although should never go above 0.5)

Type:
  • number

(static) coffeeHd :number

Coffee height display

Type:
  • number

(static) coffeeName :string

Name of the current coffee. Name in statistics

Type:
  • string

(static) coffeeProgress :number

You can a little bit for each achievement; 0-1 : coffee; 1-2 : chocolate coffee; 2-3 : raspberry coffee

Type:
  • number

(static) coffeeType :number

Custom coffee : 0=plain, 1=chocolate...

Type:
  • number

(static) computedMouseCps :number

Computed Mouse CPS

Type:
  • number

(static) cupcakeClicks :number

Count of click on cupcake, +1 for each click on the cupcake

Type:
  • number

(static) cupcakeNumbers :Array.<any>

Rising numbers

Type:
  • Array.<any>

(static) cupcakeParticles :Array.<any>

Falling cupcakes

Type:
  • Array.<any>

(static) cupcakes :number

Current count of cupcakes

Type:
  • number

(static) cupcakesEarned :number

All cupcakes earned during gameplay

Type:
  • number

(static) cupcakesPs :number

Cupcakes per second (to recalculate with every new purchase)

Type:
  • number

(static) cupcakesReset :number

Cupcakes lost to resetting

Type:
  • number

(static) cupcakesd :number

Current display count of cupcakes

Type:
  • number

(static) darkchocClicks :number

Count of click on chocolate cupcakes, +1 for each dark chocolate cupcake clicked

Type:
  • number

(static) elderWrath :number

Elder wrath target

Type:
  • number

(static) elderWrathD :number

Elder wrath now

Type:
  • number

(static) fps :number

FPS of the game. If increased - games speeds up

Type:
  • number

(static) frenzy :number

Frenzy flag, as long as >0, cupcake production is multiplied by frenzyPower

Type:
  • number

(static) frenzyPower :number

Power of Frenzy effect

Type:
  • number

(static) gamestart :number

Date when save is created

Type:
  • number

(static) globalCpsMult :number

Global CPS

Type:
  • number

(static) goldenClicks :number

Count of click on golden cupcakes, +1 for each golden cupcake clicked

Type:
  • number

(static) handmadecupcakes :number

All the cupcakes made from clicking the cupcake

Type:
  • number

(static) indcup :number

Industrial cupcake unlock flag

Type:
  • number

(static) missedGoldenClicks :number

Count of missed golden cupcake, +1 for each golden cupcake missed

Type:
  • number

(static) mouseX :number

Mouse X

Type:
  • number

(static) mouseY :number

Mouse Y

Type:
  • number

(static) muscup :number

Music cupcake unlock flag

Type:
  • number

(static) particles :Array.<any>

Generic particles

Type:
  • Array.<any>

(static) particlesY :number

Y axis of generic particles

Type:
  • number

(static) pledgeT :number

Type:
  • number

(static) pledges :number

Type:
  • number

(static) prefs :any

Game prefs

Type:
  • any

(static) prestige :any

Cool stuff that carries over beyond resets

Type:
  • any

(static) priceIncrease :number

Coefficient of price increase

Type:
  • number

(static) ready :number

Indicates the game is fully initialized

Type:
  • number

(static) satcupbought :number

Satanic cupcake unlock flag

Type:
  • number

(static) storeToRebuild :number

Store rebuild flag

Type:
  • number

(static) time :number

Current time

Type:
  • number

(static) upgradesToRebuild :number

Rebuild upgrades flag

Type:
  • number

(static) version :number

Version of the game

Type:
  • number

(static) windowH :number

Window height

Type:
  • number

(static) windowW :number

Window width

Type:
  • number

Methods

(static) AbuseGC(mode) → {void}

Sets the delay to show of GC/DCC to zero.

Parameters:
NameTypeDescription
modeany

0 - GC, 1 - DCC

Returns:
Type: 
void

(static) AddCupcake(amount, mode) → {void}

Dev function. Applies certain amount of cupcake with some mode

Parameters:
NameTypeDescription
amountany

Amount of cupcake to apply

modeany

Mode of apply. 0 - Add, 1 - Multiply, 2 - Subtract, 3 - Divide

Returns:
Type: 
void

(static) BgMusic() → {void}

Plays background audio

Returns:
Type: 
void

(static) CMastery() → {void}

Process click mastery

Returns:
Type: 
void

(static) CalculateGains() → {void}

Calculates gains

Returns:
Type: 
void

(static) CalculatePrestige() → {void}

Calculates prestige

Returns:
Type: 
void

(static) ChangeBG() → {void}

Invokes change BG image prompt

Returns:
Type: 
void

(static) ChangeCoffee(coffee) → {void}

Changes coffee

Parameters:
NameTypeDescription
coffeestring

coffee name

Returns:
Type: 
void

(static) ChangeCupcake() → {void}

Opens prompt with new cupcake img url entering

Returns:
Type: 
void

(static) ChrCode() → {void}

Opens up Christmas Code prompts

Returns:
Type: 
void

(static) Clickcupcake() → {void}

Clicks on cupcake

Returns:
Type: 
void

(static) ComputeCps(base, add, mult, bonus) → {number}

Computes CPS

Parameters:
NameTypeDescription
basenumber

Base CPS

addnumber

Add part (+)

multnumber

Mult part (*)

bonusnumber

Bonus part (all + )

Returns:
Type: 
number

(static) CupDrop() → {void}

Drops the cupcake and performs animation effects.

Returns:
Type: 
void

(static) DefaultPrefs() → {void}

Sets prefs to default

Returns:
Type: 
void

(static) Draw() → {void}

Draws all game stuff

Returns:
Type: 
void

(static) Drawbakerpocalypse() → {void}

Draws bakerpocalypse

Deprecated
  • Yes
Returns:
Type: 
void

(static) Earn(howmuch)

Gives cupcakes

Parameters:
NameTypeDescription
howmuchnumber

How much cupcake to give

(static) ExportSave() → {void}

Opens the expot save prompt

Returns:
Type: 
void

(static) GetAchieve() → {void}

Opens prompt with achieve entering

Returns:
Type: 
void

(static) GetRank() → {void}

Updates click rank

Returns:
Type: 
void

(static) HardReset() → {void}

Deletes save

Returns:
Type: 
void

(static) Has(what) → {boolean}

Returns ownes the Upgrade

Parameters:
NameTypeDescription
whatany
Returns:
Type: 
boolean

(static) HasAchiev(what) → {void}

Check for Achievement owning by name

Parameters:
NameTypeDescription
whatstring

Name of Achievement

Returns:
Type: 
void

(static) HowMuchPrestige(cupcakes) → {number}

Calculates amount of prestige from cupcakes count

Parameters:
NameTypeDescription
cupcakesnumber

Count of cupcakes to calculate

Returns:
Type: 
number

(static) ImportSave() → {void}

Opens the import save prompt

Returns:
Type: 
void

(static) Init() → {void}

Inits game

Returns:
Type: 
void

(static) Launch() → {void}

Launchs game

Returns:
Type: 
void

(static) LaunchModAPI() → {void}

Launches ModAPI

Returns:
Type: 
void

(static) LoadSave(datanullable, loadMods) → {void}

Loads save

Parameters:
NameTypeAttributesDefaultDescription
datastring<nullable>

Save data. If not present - loads from cookies

loadModsbooleantrue

If false - doesn't loads mods from localStorage

Returns:
Type: 
void

(static) Lock(what) → {void}

Locks the Upgrade

Parameters:
NameTypeDescription
whatstring

Upgrade name

Returns:
Type: 
void

(static) Logic() → {void}

Process logic

Returns:
Type: 
void

(static) Loop() → {void}

Main game loop

Returns:
Type: 
void

(static) NumtoRome(num) → {string}

Decimal number to Rome view

Parameters:
NameTypeDescription
numnumber
Returns:
Type: 
string

(static) Popup(text, …argumets) → {void}

Shows popup with some text (text will be localized by key if one is specified)

Parameters:
NameTypeAttributesDescription
textstring
argumetsArray.<any><repeatable>
Returns:
Type: 
void

(static) RandomBakeryName() → {string}

Gets up random bakery name

Returns:
Type: 
string

(static) RebuildStore() → {void}

Rebuild store

Returns:
Type: 
void

(static) RebuildUpgrades() → {void}

Recalculates upgrades

Returns:
Type: 
void

(static) Reset(bypassnullable)

Resets the game

Parameters:
NameTypeAttributesDescription
bypassboolean<nullable>

Bypass prestige

(static) RuinTheFun() → {void}

Ruins the fun)

Returns:
Type: 
void

(static) ShowMenu(what) → {void}

Shows menu by name

Parameters:
NameTypeDescription
whatstring

Menu name

Returns:
Type: 
void

(static) Spend(howmuch)

Takes cupcakes

Parameters:
NameTypeDescription
howmuchnumber

How much cupcake to take

(static) TickerDraw() → {void}

Draw the news label

Returns:
Type: 
void

(static) ToggleMusic(audioobj) → {void}

Toggles the music

Parameters:
NameTypeDescription
audioobjAudio

Object of custom audio

Returns:
Type: 
void

(static) Unlock(what) → {void}

Unlocks the Upgrade

Parameters:
NameTypeDescription
whatstring

Upgrade name

Returns:
Type: 
void

(static) UpdateLocale()

Update localization of all registred objects

(static) UpdateMenu() → {void}

Updates the menu

Returns:
Type: 
void

(static) Updatebakerpocalypse() → {void}

Updates bakerpocalypse

Deprecated
  • Yes
Returns:
Type: 
void

(static) Win(what) → {void}

Unlocks Achievement by name

Parameters:
NameTypeDescription
whatstring

Achievement name

Returns:
Type: 
void

(static) WriteSave(exporting) → {string|undefined}

Saves the game

Parameters:
NameTypeDefaultDescription
exportingbooleanfalse

Exporting flag. If false - saves gamedata in cookie and not returns. If true - returns the save data

Returns:
Type: 
string | undefined

(static) addClass(what) → {void}

Add CSS class to 'game' HTML Element

Parameters:
NameTypeDescription
whatstring

CSS class

Returns:
Type: 
void

(static) bakeryNameSet(what)

Sets up name of the bakery

Parameters:
NameTypeDescription
whatstring

(static) checktime(toim, ourtoim) → {boolean}

Checks if time is elapsed

Parameters:
NameTypeDescription
toimany

Target time

ourtoimany

Checking time

Returns:
Type: 
boolean

(static) cupcakeNumberAdd(text) → {void}

Adds rising number with text)

Parameters:
NameTypeDescription
textstring

Text of label

Returns:
Type: 
void

(static) cupcakeNumbersUpdate() → {void}

Update numbers

Returns:
Type: 
void

(static) cupcakeParticleAdd() → {void}

Add particle

Returns:
Type: 
void

(static) cupcakeParticlesUpdate() → {void}

Updates the particles

Returns:
Type: 
void

(static) getNewTicker() → {void}

Sets new news label

Returns:
Type: 
void

(static) mouseCps() → {number}

Gets the Mouse CPS with all buff from achievments

Returns:
Type: 
number

(static) particlesAdd(text, el) → {void}

Adds generic particle

Parameters:
NameTypeDescription
textstring

Text of particle

elboolean
Returns:
Type: 
void

(static) particlesUpdate() → {void}

Update generic particles

Returns:
Type: 
void

(static) removeClass(what) → {void}

Removes CSS class to 'game' HTML Element

Parameters:
NameTypeDescription
whatstring

CSS class

Returns:
Type: 
void

(static) sayTime(time, detail) → {string}

Beautifies the time

Parameters:
NameTypeDescription
timenumber

Time number

detailnumber

Detalisation. 2 - Days, 3 - Hours, 4 - Minutes, 5 - Secconds

Returns:
Type: 
string

(static) updateClasses() → {void}

Updates CSS classes to 'game' HTML Element

Returns:
Type: 
void