GithubHelp home page GithubHelp logo

ct-js / docs.ctjs.rocks Goto Github PK

View Code? Open in Web Editor NEW
65.0 4.0 40.0 46.55 MB

Official docs of ct.js game engine

Home Page: https://docs.ctjs.rocks/

vuepress docs ctjs gamedev tutorial ct-game-engine ct documentation

docs.ctjs.rocks's Issues

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

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

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

[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!

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

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 a visual novel (based on ct.yarn example)
  • 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.

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.

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:

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.

Russian docs

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

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

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.