Git Product home page Git Product logo

docs.ctjs.rocks's Introduction

ct.js Docs Creative Commons Attribution 4.0 International

Netlify Status

Nice to meet you! This repo includes the official documentation of ct.js game engine. The documentation site runs on Vuepress and is hosted on docs.ctjs.rocks.

In this repo, you can:

  • open an issue to highlight errors in docs, or send a pull request that will fix them;
  • add a new tutorial;
  • improve docs with better explanations and other stuff.

Creating pull requests

Please organize your commits so each one changes, deletes or adds one subject: a tutorial, a function, a new module, a tip, etc. Examples:

  • Adding one tutorial is a commit;
  • Adding a tip or improving a paragraph is a commit;
  • Changing an old variable to a new one across multiple documents is a commit.

Editing & running a dev server

A dev server will allow you to preview your changes with live reloading. You will need to install node.js, if you don't have it.

  1. Clone the repo with git clone https://github.com/ct-js/docs.ctjs.rocks.git;
  2. cd ./docs.ctjs.rocks/
  3. run npm install in it;
  4. run npm run dev to launch the server.

Then edit *.md files in the ./docs folder.

New entries can be added at .vuepress/config.jsthemeConfigsidebar field.

Naming convention

Use Gitmoji-flavored Comigoji guide for commit messages.

License

Except where otherwise noted, content is licensed under a Creative Commons Attribution 4.0 International License.

docs.ctjs.rocks's People

Contributors

0xffaaf avatar atavismus avatar cosmomyzrailgorynych avatar dependabot[bot] avatar designer-a avatar eeershov avatar ehanahamed avatar eilandis avatar firecakes avatar flipfloop avatar flyingpig525 avatar gamblebranch avatar girgetto avatar godmar avatar hoverbaum avatar leedigital avatar maxdefense avatar naturecodevoid avatar nicbritz avatar niutp avatar omartek avatar piyush-deshmukh avatar progzone122 avatar qewer33 avatar sampenland avatar sarturodev avatar schu34 avatar skeddles avatar tiger-the-cat avatar yonderbread avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

docs.ctjs.rocks's Issues

Russian docs

In GitLab by @Comigo on Mar 2, 2019, 02:29

  • Tutorials
  • Tips & tricks, Dragonbones
  • core's API docs
  • image localisation

[type:bug] Camera is null?

Everything seems to be fine with my game, but I keep getting this console error:
image
ct.js system code:
image
it seems that the ct.camera is null.
Thanks!

Белый экран при запуске на локальной машине

При запуске сайта на локальной машине показывается белая страница и ошибка в консоли браузера "Загрузка модуля по адресу «http://localhost:8080/@id/C:/Users/Diablo/Documents/GitHub/docs.ctjs.rocks-russian/docs/.vuepress/.temp/internal/layoutComponents» была заблокирована из-за неразрешенного MIME-типа («»)."
изображение

Tips & tricks: working with files (loading and writing)

Though there is a way to save games with localStorage, sometimes it is needed to load/write external files. Though this topic is widely covered by a js community and not a subject to be covered by ct.js functionality (as every API is pretty high-level already and there is no point for adding new catmods or core API for that), it is not obvious for game developers as they expect this to be a part of a game engine.

What needs to be documented:

  • the use of include folder in ct.js projects;
  • the use of fetch API with examples of loading images & data from include and the web. Possible use cases/examples include:
  • working with the file system in desktop apps (ct.fs). Use cases/examples may include:
    • reading a directory's contents (e.g. discovering user-made levels);
    • writing and reading JSON files;
    • deleting files.

Possibly, fs functionality may be abstracted and presented as a ct.js API in ct.desktop.

Changes to the ct.js' API to reflect in docs

  • ct. is not needed to be written. Properties that dropped the ct. prefix without major changes: meta|camera|templates|rooms|actions|inputs|content|backgrounds|styles|res|emitters|tilemaps|timer|u|pixiApp|stage|loop|fittoscreen|assert|capture|cutscene|desktop|eqs|filters|flow|fs|gamedistribution|inherit|gamepad|keyboard|mouse|pointer|nakama|noise|nanoid|place|random|sprite|storage|touch|transition|ulid|vgui|vkeys|yarn
  • ct.sound is now sounds, ct.sound.spawn is now sounds.play
  • ct.delta is now u.delta, ct.deltaUi is u.deltaUi
  • ct.room is rooms.current
  • ct.pixiApp is pixiApp
  • fittoscreen is now a hidden built-in API. Controlled through these ⬇
  • A wild settings appears:
    • highDensity is a toggleable boolean (retina mode);
    • targetFps configures target FPS and its cap;
    • viewMode is old fittoscreen's mode with one of these values (can be changed during runtime): 'asIs' | 'fastScale' | 'fastScaleInteger' | 'expand' | | 'scaleFit' | 'scaleFill'
  • camera is not writable now.
    • What's the alternative?
      • Is it really needed?
  • ct.roomWidth and ct.roomHeight are now rooms.current.viewWidth and rooms.current.viewHeight
  • /*!%start%*/ injection was removed.
  • Base classes appear. Panels and text labels can't have animation events, or animation properties.
  • Skeleton support is removed.
  • Docs for sounds API.
  • Update tutorials to match the new IDE and API

Modify Step in Platformer Tutorial

I'm busy with other things right now or I'd make a pull request of it instead.

On step "Creating a Robot Character and Ground", it says to 'Now move to the "On Step" tab and add this code:', however it is reusing the default parameter speed in the tutorial causing issues if the person following it appends the code in the tab rather than replacing it due to the default inclusion of this.move();.

Two possible solutions:

  1. Change the step to 'Now move to the "On Step" tab and replace the contents with this code:'
  2. Change the tutorial so it uses something other than this.speed for the max horizontal speed.

Documentation requests (help wanted)

There are numerous topics that would be cool if they were documented in ct.js' docs.

High priority topics

  • #68 Web-only builds. Demos. Desktop builds.
  • Same for GameJolt (can be merged with the above).

Normal priority

  • Gracefully loading and playing music and ambient sounds in web builds (preloading, fading in/out)
  • Making and using sub-animations with ct.sprite
  • Platformer movement with sloped ground
  • Working with nested copies.
  • Making UI elements that follow gameplay elements
  • Shooting to mouse location and turrets
  • Dragging copies around with touch/mouse

Low priority

  • Making a match-3 game in ct.js
  • Making cool effects with emitter tandems. Whirls, implosions/explosions, multi-layered effects, trails.

Feature: generate PDF versions for each locale

Use case: for offline use at schools, subways, for people who prefer working with pdfs (i guess), for print, and as a backup when an internet connection is not stable (it is still the case for 21st century).

This can be achieved relatively easy with one of these modules:

Pausing a game by stopping Pixi's tickers

In GitLab by @Comigo on Feb 24, 2019, 21:57

The code to pause the game is as following:

PIXI.ticker.shared.speed = 0;
ct.pixiApp.ticker.speed = 0;

And, to unpause:

PIXI.ticker.shared.speed = 1;
ct.pixiApp.ticker.speed = 1;

But it should be documented as a quick tip/tutorial in the docs, because one will never guess on how to do that, even with Pixi.js docs.

From Discord server:

If you are using ct.delta all over your game code, a simple line [...] must effectively disable motion of everything that uses that ct.delta. Default movement system with this.speed and this.direction is included here as well. At this point, the game loop will still work, meaning that UI and stuff will be responsible.
To set ct.delta back to normal, run [...].
So you need to:

  1. Spawn a pause menu;
  2. Set both tickers to 0;
  3. Set them back to 1 when a player presses the "unpause" button

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.