TCJSgame Reference Guide
This page is a quick reference to all the main classes, properties, and methods in TCJSgame. Use it as a cheat sheet when coding your games. For detailed explanations and examples, see the individual topic pages in this documentation.
Display
start(width, height, parent)stop()clear()fullScreen(),exitScreen()backgroundColor(color),lgradient(),rgradient()tileMap()add(component, scene)
Component
- Properties:
x,y,width,height,color,type,angle,physics,gravity,gravitySpeed,bounce - Methods:
update(),bUpdate(),move(),moveAngle(),hitBottom(),stopMove(),clicked(),crashWith(other),hide(),show()
Camera
- Properties:
x,y,worldWidth,worldHeight - Method:
follow(target, smooth)
TileMap
show(),tiles(id),crashWith(obj, id)add(id, tx, ty),remove(tx, ty),rTile(tx, ty)
Sound
play(),stop()
Move Utilities
teleport(),glideX(),glideY(),glideTo()project(),pointTo(),accelerate(),decelerate(),position()hitObject(),bound(),boundTo()
State Utilities
distance(),rect(),physics(),changeAngle(),Angle(),pos()
Sprites
- Properties:
frameWidth,frameHeight,frameCount,frameSpeed - Methods:
update(),draw(ctx, x, y)
Note: This reference is not a replacement for learning.
It is meant as a quick lookup tool once you are already familiar with how
each feature works.