Skip to content

Instantly share code, notes, and snippets.

@naturecodevoid
Last active September 8, 2020 18:38
Show Gist options
  • Save naturecodevoid/c2e673203d55f482f26e6ffb546956a0 to your computer and use it in GitHub Desktop.
Save naturecodevoid/c2e673203d55f482f26e6ffb546956a0 to your computer and use it in GitHub Desktop.
ct.js FAQ

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 make 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


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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment