ct.js FAQ
The camera won't follow my charater!
Make sure you have this code in your character's 'On Create' tab:
ct.camera.follow = this;
// Optional; sets the frame inside which the copy will be kept, in game pixels. Can be set to `null` so the copy is set to the center of the screen.
ct.camera.borderX = 450;
ct.camera.borderY = 200;
How can I read the string typed with a keyboard?
You'll need the keyboard
catmod. (Go to Project
tab > Catmods
> Search for Keyboard
. It will have a red ❌ if it's disabled. Press it to enable.)
To get keyboard input, use the variable ct.keyboard.string
. Keep in mind this will reset when the Enter
key is pressed.
Why is my game blurry?/Pixel art is smoothed
If your game has pixel art, you will need to enable this option.
Go to the Project
tab > Render Options
and enable Disable image smoothing here and in exported project (preserve crisp pixels)
. This should fix the problem.
I'm trying to music in my game menu, but no sound plays!
This is because PIXI.js is unable to play sounds unless the program has been interacted with, try adding something the player can interact with first before entering the menu, such as clicking any key to start.
Troubleshooting Links
- Teared background: https://docs.ctjs.rocks/troubleshooting-teared-background.html
If you can't find an answer to your question here, try asking in <#490054175141527552>. You may want to work on another part of your ct.js project while waiting for an answer.