MCPcopy Create free account

hub / github.com/MagicCube/tensorflow-rex-run / functions

Functions146 in github.com/MagicCube/tensorflow-rex-run

↓ 11 callersMethodinit
()
src/ai/models/Model.js:4
↓ 9 callersMethodupdate
* Update the game frame and schedules the next one.
src/game/Runner.js:264
↓ 7 callersFunctiongetImageSprite
()
src/game/ImageSprite.js:3
↓ 6 callersFunctiongetRandomNum
(min, max)
src/game/utils.js:15
↓ 6 callersFunctiongetTimeStamp
()
src/game/utils.js:5
↓ 6 callersMethodupdate
* Set the animation status. * @param {!number} deltaTime * @param {Trex.status} status Optional status to switch to.
src/game/Trex.js:152
↓ 5 callersMethodfit
(inputXs, inputYs, iterationCount = 100)
src/ai/models/Model.js:26
↓ 5 callersMethodpredictSingle
(inputX)
src/ai/models/Model.js:16
↓ 5 callersMethodreset
* Reset the t-rex to running at start of game.
src/game/Trex.js:360
↓ 4 callersMethoddraw
* Draw the t-rex to a particular position. * @param {number} x * @param {number} y
src/game/Trex.js:195
↓ 4 callersFunctiongetFPS
()
src/game/RuntimeConfig.js:3
↓ 4 callersFunctionrandom
()
src/ai/models/random/RandomModel.js:33
↓ 4 callersMethodrestart
()
src/game/Runner.js:442
↓ 4 callersMethodsetDuck
* @param {boolean} isDucking.
src/game/Trex.js:347
↓ 3 callersMethodaddCloud
* Add a new cloud to the horizon.
src/game/Horizon.js:224
↓ 3 callersMethodclearCanvas
()
src/game/Runner.js:252
↓ 3 callersFunctionconvertStateToVector
(state)
src/apps/nn.js:77
↓ 3 callersFunctionconvertStateToVector
(state)
src/apps/nnm.js:82
↓ 3 callersFunctionconvertStateToVector
(state)
src/apps/genetic-nn.js:97
↓ 3 callersMethoddraw
* Draw a digit to canvas. * @param {number} digitPos Position of the digit. * @param {number} value Digit value 0-9. * @param {boolean} highS
src/game/DistanceMeter.js:95
↓ 2 callersMethodaddNewObstacle
* Add a new obstacle. * @param {number} currentSpeed
src/game/Horizon.js:153
↓ 2 callersFunctionboxCompare
* Compare two collision boxes for a collision. * @param {CollisionBox} tRexBox * @param {CollisionBox} obstacleBox * @return {boolean} Whether the
src/game/Trex.js:451
↓ 2 callersMethodcalcXPos
* Calculate the xPos in the canvas. * @param {number} canvasWidth
src/game/DistanceMeter.js:83
↓ 2 callersFunctioncreateAdjustedCollisionBox
* Adjust the collision box. * @param {!CollisionBox} box The original box. * @param {!CollisionBox} adjustment Adjustment box. * @return {Collision
src/game/Trex.js:436
↓ 2 callersMethoddraw
* Draw the cloud.
src/game/Cloud.js:55
↓ 2 callersMethoddraw
* Draw the horizon line.
src/game/HorizonLine.js:64
↓ 2 callersMethoddraw
* Draw and crop based on size.
src/game/Obstacle.js:160
↓ 2 callersMethodendJump
* Jump is complete, falling down.
src/game/Trex.js:288
↓ 2 callersMethodgetActualDistance
* Covert pixel distance to a 'real' distance. * @param {number} distance Pixel distance ran. * @return {number} The 'real' distance ran.
src/game/DistanceMeter.js:140
↓ 2 callersMethodgetChromosome
()
src/ai/models/genetic-nn/NNModel.js:5
↓ 2 callersMethodisVisible
* Check if the cloud is visible on the stage. * @return {boolean}
src/game/Cloud.js:95
↓ 2 callersMethodlives
()
src/game/TrexGroup.js:49
↓ 2 callersMethodrandomize
()
src/ai/models/random/RandomModel.js:25
↓ 2 callersMethodsetBlinkDelay
* Sets a random time for the blink to happen.
src/game/Trex.js:244
↓ 2 callersMethodsetChromosome
(chromosome)
src/ai/models/genetic-nn/NNModel.js:15
↓ 2 callersMethodsetSpeed
* Sets the game speed. Adjust the speed accordingly if on a smaller screen. * @param {number} speed
src/game/Runner.js:239
↓ 2 callersMethodsetSpeedDrop
* Set the speed drop. Immediately cancels the current jump.
src/game/Trex.js:339
↓ 2 callersMethodstartJump
* Initialise a jump. * @param {number} speed
src/game/Trex.js:271
↓ 2 callersMethodstop
()
src/game/Runner.js:427
↓ 2 callersFunctiontensor
(obj)
src/ai/utils/index.js:7
↓ 2 callersMethodtrain
(inputXs, inputYs)
src/ai/models/Model.js:20
↓ 2 callersMethodupdate
* @param {number} deltaTime * @param {number} currentSpeed * @param {boolean} updateObstacles Used as an override to prevent * the obstac
src/game/Horizon.js:64
↓ 2 callersMethodupdateCanvasScaling
* Updates the canvas size taking into * account the backing store pixel ratio and * the device pixel ratio. * * See article by Paul Lewis:
src/game/Runner.js:482
↓ 2 callersMethodupdateXPos
* Update the x position of an indivdual piece of the line. * @param {number} pos Line position. * @param {number} increment
src/game/HorizonLine.js:95
↓ 1 callersMethodadjustDimensions
* Adjust game space dimensions on resize.
src/game/Runner.js:200
↓ 1 callersMethodblink
* Make t-rex blink at random intervals. * @param {number} time Current time in milliseconds.
src/game/Trex.js:252
↓ 1 callersFunctioncheckForCollision
(obstacle, tRex)
src/game/Trex.js:381
↓ 1 callersMethodcheckForCollision
(obstacle)
src/game/TrexGroup.js:53
↓ 1 callersMethodcloneCollisionBoxes
* Make a copy of the collision boxes, since these will change based on * obstacle type and size.
src/game/Obstacle.js:244
↓ 1 callersFunctionconvertStateToVector
(state)
src/apps/random.js:50
↓ 1 callersFunctionconvertStateToVector
(state)
src/apps/genetic.js:66
↓ 1 callersFunctioncreateCanvas
* Create canvas element. * @param {HTMLElement} container Element to append canvas to. * @param {number} width * @param {number} height * @param {
src/game/Runner.js:524
↓ 1 callersMethodcrossOver
(parents, chromosomes)
src/ai/models/genetic/GeneticModel.js:19
↓ 1 callersMethoddrawHighScore
* Draw the high score.
src/game/DistanceMeter.js:207
↓ 1 callersMethodduplicateObstacleCheck
* Returns whether the previous two obstacles are the same as the next one. * Maximum duplication is set in config value MAX_OBSTACLE_DUPLICATION.
src/game/Horizon.js:192
↓ 1 callersMethodgameOver
* Game over state.
src/game/Runner.js:406
↓ 1 callersMethodgetGap
* Calculate a random gap size. * - Minimum gap gets wider as speed increses * @param {number} gapCoefficient * @param {number} speed * @re
src/game/Obstacle.js:224
↓ 1 callersMethodgetRandomType
* Return the crop x position of a type.
src/game/HorizonLine.js:57
↓ 1 callersMethodinit
* Initialise the distance meter to '00000'. * @param {number} width Canvas width in px.
src/game/DistanceMeter.js:65
↓ 1 callersMethodinit
* Initialise the cloud. Sets the Cloud height.
src/game/Cloud.js:44
↓ 1 callersMethodinit
* T-rex player initaliser. * Sets the t-rex to blink at random intervals.
src/game/Trex.js:129
↓ 1 callersMethodinit
* Initialise the horizon. Just add the line and a cloud. No obstacles.
src/game/Horizon.js:52
↓ 1 callersMethodinit
(speed)
src/game/Obstacle.js:110
↓ 1 callersMethodisRunning
* Whether the game is running. * @return {boolean}
src/game/Runner.js:399
↓ 1 callersMethodisVisible
* Check if obstacle is visible. * @return {boolean} Whether the obstacle is in the game area.
src/game/Obstacle.js:236
↓ 1 callersFunctionloadImageSprite
()
src/game/ImageSprite.js:7
↓ 1 callersMethodloss
(predictedYs, labels)
src/ai/models/Model.js:32
↓ 1 callersMethodmutate
(chromosomes)
src/ai/models/genetic/GeneticModel.js:39
↓ 1 callersMethodonKeyDown
* Process keydown. * @param {Event} e
src/game/Runner.js:345
↓ 1 callersMethodonKeyUp
* Process key up. * @param {Event} e
src/game/Runner.js:369
↓ 1 callersMethodpredict
(inputXs)
src/ai/models/Model.js:10
↓ 1 callersMethodpredict
(inputXs)
src/ai/models/nn/NNModel.js:40
↓ 1 callersMethodscheduleNextUpdate
* RequestAnimationFrame wrapper.
src/game/Runner.js:388
↓ 1 callersMethodselect
(chromosomes)
src/ai/models/genetic/GeneticModel.js:14
↓ 1 callersMethodsetHighScore
* Set the highscore as a array string. * Position of char in the sprite: H - 10, I - 11. * @param {number} distance Distance ran in pixels.
src/game/DistanceMeter.js:221
↓ 1 callersMethodsetSourceDimensions
* Set the source dimensions of the horizon line.
src/game/HorizonLine.js:43
↓ 1 callersMethodstartGame
* Update the game status to started.
src/game/Runner.js:246
↓ 1 callersMethodstartListening
* Bind relevant key
src/game/Runner.js:332
↓ 1 callersMethodtrain
(chromosomes)
src/ai/models/genetic/GeneticModel.js:4
↓ 1 callersMethodupdate
* Update the distance meter. * @param {number} distance * @param {number} deltaTime
src/game/DistanceMeter.js:149
↓ 1 callersMethodupdateClouds
* Update the cloud positions. * @param {number} deltaTime * @param {number} currentSpeed
src/game/Horizon.js:79
↓ 1 callersMethodupdateJump
* Update frame for a jump. * @param {number} deltaTime * @param {number} speed
src/game/Trex.js:302
↓ 1 callersMethodupdateObstacles
* Update the obstacle positions. * @param {number} deltaTime * @param {number} currentSpeed
src/game/Horizon.js:111
Methodconstructor
(canvas, spritePos, canvasWidth)
src/game/DistanceMeter.js:36
Methodconstructor
(canvas, spritePos, containerWidth)
src/game/Cloud.js:25
Methodconstructor
(canvas, spritePos)
src/game/Trex.js:95
Methodconstructor
(canvas, spritePos, dimensions, gapCoefficient)
src/game/Horizon.js:28
Methodconstructor
(outerContainerId, options)
src/game/Runner.js:82
Methodconstructor
(canvas, spritePos)
src/game/HorizonLine.js:22
Methodconstructor
( canvasCtx, type, spriteImgPos, dimensions, gapCoefficient, speed, offset )
src/game/Obstacle.js:80
Methodconstructor
(count, canvas, spriteDef)
src/game/TrexGroup.js:9
Methodconstructor
(x, y, w, h)
src/game/CollisionBox.js:12
Methodconstructor
({ inputSize = 3, hiddenLayerSize = inputSize * 2, outputSize = 2, learningRate = 0.1 } = {}
src/ai/models/nn/NNModel.js:13
FunctionconvertStateToVector
(state)
src/apps/template.js:35
MethoddebounceResize
* Debounce the resize event.
src/game/Runner.js:191
Methoddraw
(x, y)
src/game/TrexGroup.js:26
Methodfit
(chromosomes)
src/ai/models/genetic/GeneticModel.js:10
MethodgetChromosome
()
src/ai/models/genetic/RandomModel.js:4
FunctionhandleCrash
({ tRex })
src/apps/nn.js:61
FunctionhandleCrash
({ tRex })
src/apps/nnm.js:68
next →1–100 of 146, ranked by callers