Skip to content

Commit

Permalink
Merge branch 'release/v1.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Nov 26, 2019
2 parents 88640c6 + 2a65a1f commit ebbc54f
Show file tree
Hide file tree
Showing 168 changed files with 11,938 additions and 21,946 deletions.
12 changes: 8 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@ desktop\.ini
*.png~

# Generated files
src/typedefs/ct.js/types.d.ts
app/data/bundle.js
app/data/bundle.css
app/data/node_requires/**/*.js
app/data/node_requires/**/*
app/data/fonts/style/.css
app/data/theme*.css
app/data/typedefs/global.d.ts
/app/data/docs
app/index.html
app/preview.html
app/empty.html
app/data/theme*.css
app/temp
app/exportDesktop
app/temp
/temp
app/data/fonts/style/.css
app/data/patronsCache.csv
builds
build
cache
/app/data/docs
tempChangelog.md

# tests
Expand Down
2 changes: 1 addition & 1 deletion DragonBonesJS
Submodule DragonBonesJS updated 117 files
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,35 @@ For bugs, feature requests, developing questions, please use [GitHub issues](htt
* `DragonBonesJS` — a dependency for enabling DragonBones' skeletal animation support in ct.js.
* `SSCD.js`[a fork](https://github.com/CosmoMyzrailGorynych/SSCD.js) of a collision library for ct.place.

# Forking and installing the dev environment
# Developing ct.js

## Planning

See the [main dev board](https://github.com/orgs/ct-js/projects/1) for hot issues and plans for next releases. Prioritize the "Current release" column, then "To Do", then "Backlog", though if you really want a feature from a backlog to come true right here, right now, no one can stop you :)

Please leave a comment in issues you want to work on so that we can assign you to them and avoid occasional double work from several contributors.

## Forking and installing the dev environment

Building ct.js requires [Node and npm](https://nodejs.org/en/download/) installed on your machine.

```sh
git clone https://github.com/ct-js/ct-js.git ctjs
cd ./ctjs
npm install gulp-cli -g
npm install
gulp -f devSetup.gulpfile.js
```

# Running ct.js from sources
## Running ct.js from sources

```sh
gulp
```

# Releasing ct.js
## Releasing ct.js

This is left for emergencies only, as Travis should prepare binaries for github and send them to itch.io as well

```sh
# Builds docs and adds them to ct.js app
Expand All @@ -63,6 +74,6 @@ gulp deploy

The first run will be slow as it will download nw.js binaries. Next runs will use cached files.

# Naming conventions for commits
## Naming conventions for commits

Use [Gitmoji-flavored Comigoji](https://comigo.gitlab.io/comigoji/#gitmoji) for naming your commits.
67 changes: 67 additions & 0 deletions app/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,70 @@
## v 1.2.0

*Tue Nov 26 2019*

### ✨ New Features

* A new, better code editor with live type checks, built-in doc popups, and more!
* Add a render option to include a legacy renderer for older browsers
* Choose a custom folder for a project when creating it (#138 by @leedigital)
* Hotkeys for most tabs and resource creation
* Import modules from a *.zip file, in the Catmods tab (#142 by @leedigital)
* Patreon screen
* Resize the viewport with ct.width and ct.height
* Show/Hide the mouse cursor with ct.mouse.show, ct.mouse.hide (#143 by @Wend1go)

### ⚡️ General Improvements

* Add a `finally` method for cutscene's promise-like objects
* Add patreon translation to German (#140 by @Wend1go)
* Allow to change ct.fittoscreen's scaling mode at game's runtime
* Create dummy typedefs for modules that don't provide them

### 🐛 Bug Fixes

* An asset should not be allowed to apply if it has an already occupied name
* Fix broken zipped projects on windows
* Fix multiple tiles not being placed while the Shift key is pressed
* Fix non-working export settings on really old projects
* Show proper error message when switching to a non-existent room (#144 by @Wend1go)
* Update DragonBones and fix issues with skeleton import

### 🍱 Demos and Stuff

* Add typedefs for `ct.tween`
* Add typings for `ct.cutscene`
* Add typings for `ct.random`
* Add typings for `ct.vkeys`
* Complete typings for `ct.eqs`
* Typedefs for `ct.flow`
* Typedefs for `ct.touch`
* Typedefs for `ct.yarn`
* Typings for `ct.fittoscreen`
* Typings for `ct.sprite`

### 📝 Docs

* Document `ct.width` and `ct.height`
* :bug: Fix mistakes in `ct.eqs`' docs
* :sparkles: Complete translation of Pt-BR docs
* :zap: Add a clarification to the second variant of a platform's code at tut-making-platformer
* :zap: Document the process of adding typedefs for modules
* :zap: Update tut-making-platformer.md (by @Eilandis)

### 🌐 Website

* :bug: Fix a link to site's code license in the footer
* :bug: Fix emojis in 1.1.0 changelog entry
* :bug: Fix links in reusable stuff
* :sparkles: A proper language selector
* :sparkles: PT-BR translation on ct.js-site (by @GumpFlash)
* :zap: Add a translated contact form for Russian locale
* :zap: Better adaptivity
* :zap: Better handling of optionally translated pages
* :zap: Make the page "made with ct.js" dynamic and based on itch.io engine page
* :zap: Tons of improvements here and there
* :zap: Tons of new icons

## v 1.1.0

*15 October 2019*
Expand Down
1 change: 1 addition & 0 deletions app/data/DragonBones.min.js

Large diffs are not rendered by default.

Binary file modified app/data/Failure.wav
Binary file not shown.
Binary file modified app/data/Success.wav
Binary file not shown.
1 change: 1 addition & 0 deletions app/data/ct.libs/cutscene/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
});
cutscene.then = promise.then.bind(promise);
cutscene.catch = promise.catch.bind(promise);
cutscene.finally = promise.finally.bind(promise);
return cutscene;
}
};
Expand Down
62 changes: 62 additions & 0 deletions app/data/ct.libs/cutscene/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
interface ICutscene extends Promise<void>{

/**
* Indicates whether or not the video was removed,
* either manually or automatically after the video has ended.
*/
removed: bool;

/**
* The url of a video that is currently playing
*/
url: string;

/**
* A reference to the player; its types depends on the vide provider that is used.
* For local videos, this is an HTML `<video>` tag.
*/
raw: any;
}

declare namespace ct {
namespace cutscene {
/**
* Shows the cutscene and returns a reference to it.
*
* It can be a link to youtube or vimeo or a direct link to a video. These values are valid:
*
* * `https://youtu.be/xxxxxxxxxx`
* * `https://www.youtube.com/watch?v=xxxxxxxxxx`
* * `https://www.youtube.com/embed/xxxxxxxxxx`
* * `https://vimeo.com/xxxxxxxxxx`
* * `https://player.vimeo.com/video/xxxxxxxxxx`
* * `https://awesomegames.rock/trailers/catmintide.mp4`
* * `./myVideo.mp4` (if you put it inside your `project/include` folder)
*/
function show(url: string): ICutscene;

/**
* Use this to manually remove the player. If the video ends,
* it will be removed automatically, but you probably
* want to provide controls to a player, e.g. Escape button
* to skip the cutscene.
*
* **Example:**
* ```js
* // Say, this is placed in a room's On Create event
* this.cutscene = ct.cutscene.show('https://www.youtube.com/watch?v=F8VzZe1FqEM');
* cutscene.then(() => {
* this.cutscene = void 0;
* }).catch(error => {
* console.error(error);
* });
*
* // In its Step event
* if (ct.actions.Exit.pressed && this.cutscene) {
* ct.cutscene.remove(this.cutscene);
* }
* ```
*/
function remove(cutscene: ICutscene): void;
}
}
18 changes: 7 additions & 11 deletions app/data/ct.libs/eqs/DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ Execute a function for each point in the query. Function is passed the only argu
Works only with queries of `'grid'` type. Execute a function for each point in the query. Function is passed four arguments:

0. the current point;
1. its column index (the `x` position);
2. its row index (the `y` position);
3. the whole map of points (a two-dimentional array of points).
1. the whole map of points (a two-dimentional array of points);
2. the current point's column index (the `x` position);
3. the current point's row index (the `y` position);

#### `sort()`

Expand Down Expand Up @@ -114,10 +114,6 @@ Gets a random point from a query, but the first ones have the highest chance to

### Utilities

#### `draw()`

Draws all the points on the screen. Red points indicate that their `score` is `0`, and green ones have a score of `1`.

#### `concat(EQSQuery)`

Returns a new query combined from two other queries.
Expand All @@ -126,18 +122,18 @@ Returns a new query combined from two other queries.

### `ct.eqs.scoreFree(ctype, multiplier)`

A scoring function that tests whether a point collides with a `ctype` group. `multiplayer` is multiplied with a point's `score` value if a point does not collide with a given collision group (default one is `0`).
Creates a scoring function that tests whether a point collides with a `ctype` group. `multiplier` is multiplied with a point's `score` value if a point does not collide with a given collision group (default one is `0`).

### `ct.eqs.scoreOccupied(ctype, multiplier)`

A scoring function that tests whether a point collides with a `ctype` group. `multiplayer` is multiplied with a point's `score` value if a point collides with a given collision group (default one is `0`).
Creates a scoring function that tests whether a point collides with a `ctype` group. `multiplier` is multiplied with a point's `score` value if a point collides with a given collision group (default one is `0`).

### `ct.eqs.scoreTile(layer, multiplier)`

A scoring function that tests whether a point collides with a tile layer. `layer` determines the depth of a tested tile layer. `multiplayer` is multiplied with a point's `score` value if a point collides with any tile (default one is `0`).
Creates a scoring function that tests whether a point collides with a tile layer. `layer` determines the depth of a tested tile layer. `multiplier` is multiplied with a point's `score` value if a point collides with any tile (default one is `0`).

### `ct.eqs.scoreDirection(direction, fromx, fromy, weight)`

Given a point (`fromx`, `fromy`), this method calculates direction values from each points to the (`fromx`, `fromy`) point, and then ranks these points depending on how close the resulting direction is to a given `direction` argument. If directions are equal, a point's `score` is unchanged. If directions are perpendicular, a point's `score` is halved. If directions are opposite, then a point's `score` is set to 0.
Given a point (`fromx`, `fromy`), this method creates a scoring function that calculates direction values from each points to the (`fromx`, `fromy`) point, and then ranks these points depending on how close the resulting direction is to a given `direction` argument. If directions are equal, a point's `score` is unchanged. If directions are perpendicular, a point's `score` is halved. If directions are opposite, then a point's `score` is set to 0.

The `weight` parameter tells how much this ranking function should affect a point's `score`.
7 changes: 4 additions & 3 deletions app/data/ct.libs/eqs/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(() => {
var validate = (val, name, type) => {
const validate = (val, name, type) => {
if (val === void 0) {
throw new Error(`[ct.eqs] The \`${name}\` property is required.`);
} else if (type && typeof val !== type) {
Expand All @@ -8,6 +8,7 @@
return val;
};
class EQSQuery {
// eslint-disable-next-line complexity
constructor(options) {
if (options instanceof EQSQuery) {
this.points = [...options.points];
Expand Down Expand Up @@ -178,7 +179,7 @@
return this.points[Math.floor(Math.random()*Math.random() * this.points.length)];
}
}

ct.eqs = {
query(params) {
return new EQSQuery(params);
Expand Down Expand Up @@ -210,7 +211,7 @@
scoreDirection(direction, fromx, fromy, weight) {
weight = weight || 1;
return function (point) {
point.score *= (1 - Math.abs(ct.u.deltaDir(direction, ct.u.pdn(fromx, fromy, point.x, point.y))) / 180)*weight
point.score *= (1 - Math.abs(ct.u.deltaDir(direction, ct.u.pdn(fromx, fromy, point.x, point.y))) / 180)*weight
+ point.score*(1-weight);
};
}
Expand Down
Loading

0 comments on commit ebbc54f

Please sign in to comment.