Skip to content

Commit

Permalink
Merge commit 'd5c64dfcab212dcc592a032c0d28bce7477e8c1b'
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmoMyzrailGorynych committed Jul 20, 2024
2 parents a76390c + d5c64df commit 24c30eb
Show file tree
Hide file tree
Showing 97 changed files with 2,614 additions and 480 deletions.
1 change: 1 addition & 0 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ daysUntilClose: 90
exemptLabels:
- 'type:epic'
- 'type:debt'
- eternal
# Label to use when marking an issue as stale
staleLabel: 'state:stale'
# Comment to post when marking an issue as stale. Set to `false` to disable
Expand Down
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@

**Ct.js is a 2D game engine and IDE** that aims to be powerful and flexible while still being easy to use and learn. It does that by providing extensive documentation, examples, a wide variety of game asset types and their visual editors — all while remaining open to modding, and if modding doesn't help, you can always put plain JS code in your project.

People **code in ct.js with TypeScript, JavaScript, or CoffeeScript**. Coding is built around the event system, and shared code is implemented as behaviors that can be combined and used by several object templates or levels (as opposed to inheritance).
| | | Ct.js features | | |
|-|-|-|-|-|
| 🏗️ Level & UI editor | 🎶 Dynamic sound engine | ✨ Particle systems with a visual editor | 🧑‍💻 Several scripting languages to choose from | 🔔 Event-based scripting |
| 🖥️ One-click export for desktop platforms | 🌐 One-click export for web | 📱 Ready for PC and mobile games | 🔥 Fast, runs in WebGL | 💅 Free with no hidden subscribtions or fees |
| 🎞️ Frame-by-frame animations | 🗺️ Automatic atlas packing | 🕹️ Joystic support | ⌨️ Layout-agnostic input events | 🏁 Tilemap support |
| ⚽ Physics module | 👾 Arcade collision module | 🗂️ Local databases for complex data types | 🧠 Behaviors for gameplay logic composition | ✅ Base classes for UI elements |
| 🎨 Application branding | 🐻‍❄️ White-labelling | ➕ Add custom JS, CSS, or HTML | ⚙️ Flexible modular library | 📚 Extendable with special modules (catmods) |

People **code in ct.js with TypeScript, JavaScript, CoffeeScript, or ct.js' visual scripting language Catnip**. Coding is built around the event system, and shared code is implemented as behaviors that can be combined and used by several object templates or levels (as opposed to inheritance).

## How ct.js and its games are made?

Expand Down Expand Up @@ -55,8 +63,7 @@ For bugs, feature requests, development questions, please use [GitHub issues](ht
* `src` — a source folder that compiles into `/app` folder at a build time.
* `ct.release` — the ct.js game library, aka its "core"
* `js` — different top-level scripts, including 3rd-party libraries.
* `node_requires` — built and copied to the `/app` directory.
* `pug` — HTML sources of editor's windows, written in [Pug](https://pugjs.org/).
* `node_requires` — shared JavaScript and TypeScript modules that cover exporter's functionality, asset management, utilities and such.
* `riotTags` — components that drive UI logic in ct.js. Written in [Pug](https://pugjs.org/) and [Riot.js v3](https://v3.riotjs.now.sh/).
* `styl` — style sheets, written in [Stylus](http://stylus-lang.com/).
* `branding` — logos and icons belong here.
Expand All @@ -67,10 +74,13 @@ For bugs, feature requests, development questions, please use [GitHub issues](ht

## Planning

See the [main dev board](https://github.com/orgs/ct-js/projects/5/views/7) 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 :)
Relatively large issues get posted in the [main dev board](https://github.com/orgs/ct-js/projects/5/views/7), along with issues that require help from the community. 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 on issues you want to work on so that we can assign you to them and avoid occasional double work from several contributors.

You can chat and discuss ct.js development in [ct.js' Discord server](https://comigo.games/discord), in #engine-development channel.


## Forking and installing the dev environment

Building ct.js requires [Node and npm](https://nodejs.org/en/download/) installed on your machine.
Expand Down
62 changes: 62 additions & 0 deletions app/Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,65 @@
## v5.1.0

*Sat Jul 20 2024*

### ✨ New Features

* Enumeration asset type to create lists of predefined values for content types, behaviors, and to be used directly in code
* Global asset search accessible with the 🔍 icon in the top-right and the Ctrl+P hotkey
* Map data type in content types and behaviors' fields
* New `random.enumValue` method
* Paste textures with Ctrl+V while on the Assets tab
* Pixel-perfect mode for Scrolling Texture base class
* Place filled rectangles of copies or tiles with Shift+Ctrl modifier in a room editor
* Room editor: show a counter when placing copies or tiles in a straight line (with a Shift key)

### ⚡️ General Improvements

* Allow closing most success/error/warning messages in the bottom-right corner with a click
* Catnip: Add xprev, yprev blocks to the Movement category
* Disable Vulkan support by default due to frequent issues with it on Linux
* Ignore actions on not-yet loaded sounds; improve migration from v3 to v5 (#532 by @godmar)
- sound actions on sounds that haven't been loaded are now ignored
- sound.playing returns false for sounds not yet loaded instead of crashing
- strip ct from ct.tween during migration
- delete deprecated mouse catmod on 4.0.1 migration to prevent crash
* Internal: Improve how ct.js exposes base classes and Room to code editors
* Navigate through catnip in-place block search with arrow keys
* Remember last used tileset in an edited room
* Tweak styles of menus a bit so they don't change the height of a menu item when hovered
* Use fixed port number for in-editor docs and debugger so that localStorage doesn't vanish on ct.js restart. Also fixes memory leak with lingering web servers after closing a project.
* Use UI theme colors in room editor's tile picker
* Widen the asset confirmation dialog a bit
* :globe_with_meridians: Update debug and comments translation files
* :globe_with_meridians: Update Russian translation files
* :globe_with_meridians: Update Turkish translation file (by @Sarpmanon)

### 🐛 Bug Fixes

* :bento: Fix sound recorder by replacing microm package with @tscole/mic-recorder-to-mp3
* Add missing translation keys for actions
* Fetch patrons list on devSetup so there're no cache errors while developing locally
* Fix backgrounds blocking click events on copies and tiles
* Fix ct.transition causing an infinite recursion of room removal in its transitions
* Fix Ctrl+G hotkey in the room editor
* Fix mutators making broken blocks if a new `blocks` piece was introduced in a target block. Fixes errors with If-Else blocks that were mutated from If blocks
* Fix nested copies not being removed from appended/prepended rooms when a user calls `rooms.remove` on them.
* Fix not being able to port v3 versions to v5 (fixes incorrect sound conversion)
* Fix UI rooms positioned in reverse coordinate system when using this.x, this.y instead of this.position.x, this.position.y
* Importing a texture from a Buffer must prompt a user for a texture name

### 🌐 Website

* :bento: Resolve some npm audit warnings
* :bug: Fix misaligned icons in the navbar
* :zap: Add a Github link to the navbar
* :zap: Add a warning about shitty antiviruses and put a GH issue link for users to report about these cases
* :zap: Automate the changelog page by fetching the release notes from Github
* :zap: Support github issues and users mentions in markdown (for the changelog page)
* :zap: Update Japanese translation (by @taxi13245)
- Clarified ambiguous expressions.
- Added translations.

## v5.0.1

*Sat Jun 15 2024*
Expand Down
5 changes: 5 additions & 0 deletions app/data/ct.libs/random/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ Object.assign(random, {
}
return text;
},
enumValue(en) {
const vals = Object.values(en).filter(v => Number.isFinite(v));
return random.from(vals);
},
// Mulberry32, by bryc from https://stackoverflow.com/a/47593316
createSeededRandomizer(a) {
return function seededRandomizer() {
Expand All @@ -107,3 +111,4 @@ Object.assign(random, {
};
random.setSeed(9323846264);
}
window.random = random;
5 changes: 5 additions & 0 deletions app/data/ct.libs/random/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ declare namespace random {
*/
function text(text: string): string;

/**
* Returns a random value from a given enumeration.
*/
function enumValue(en: Record<number, string>): number;

/**
* When given both `x` and `y`, randomly returns `true` approximately `x` times
* out of `y`. When given only a value between 0…100, returns `true`
Expand Down
8 changes: 4 additions & 4 deletions app/data/ct.libs/transition/injections/templates.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
void 0;
},
onDestroy() {
rooms.remove(this.room);
void 0;
},
onCreate() {
this.tex = -1;
Expand Down Expand Up @@ -58,7 +58,7 @@
void 0;
},
onDestroy() {
rooms.remove(this.room);
void 0;
},
onCreate() {
this.tex = -1;
Expand Down Expand Up @@ -110,7 +110,7 @@
void 0;
},
onDestroy() {
rooms.remove(this.room);
void 0;
},
onCreate() {
this.tex = -1;
Expand Down Expand Up @@ -211,7 +211,7 @@
void 0;
},
onDestroy() {
rooms.remove(this.room);
void 0;
},
onCreate() {
this.tex = -1;
Expand Down
4 changes: 3 additions & 1 deletion app/data/i18n/Brazilian Portuguese.json
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,9 @@
"fieldReadableName": "Nome legível",
"fieldReadableNameHint": "A versão legível do nome que será utilizado no editor de conteúdo.",
"fieldType": "Tipo",
"array": "Array",
"structureTypes": {
"array": "Array"
},
"deleteContentType": "Delete esse tipo de conteúdo",
"confirmDeletionMessage": "Certeza que você quer deletar esse tipo de conteúdo? Isso é irreversível e também deletará todas as entradas desse tipo de conteúdo.",
"gotoEntries": "Vá para as entradas",
Expand Down
4 changes: 3 additions & 1 deletion app/data/i18n/Chinese Simplified.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,9 @@
"confirmDeletionMessage": "您确定要删除此内容类型吗? 它是不可逆的, 并且也将删除该内容类型的所有条目.",
"gotoEntries": "进入条目",
"entries": "条目",
"array": "数组",
"structureTypes": {
"array": "数组"
},
"fixedLength": "固定长度"
},
"contentTypes": "内容类型",
Expand Down
68 changes: 57 additions & 11 deletions app/data/i18n/Comments.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
"",
"",
""
],
"enum": [
"",
"",
""
]
},
"next": "",
Expand Down Expand Up @@ -590,7 +595,8 @@
"deleteScript": "",
"moveDown": "",
"moveUp": "",
"newScriptComment": ""
"newScriptComment": "",
"scriptsHint": ""
},
"catmodsSettings": "",
"export": {
Expand All @@ -608,7 +614,11 @@
"assetTreeNote": "",
"exportAssetTree": "",
"exportAssetTypes": "",
"autocloseDesktop": ""
"autocloseDesktop": "",
"errorReporting": "",
"showErrors": "",
"showErrorsHint": "",
"errorsLink": ""
},
"content": {
"heading": "",
Expand All @@ -630,8 +640,16 @@
"confirmDeletionMessage": "",
"gotoEntries": "",
"entries": "",
"array": "",
"fixedLength": ""
"fixedLength": "",
"fieldStructure": "",
"structureTypes": {
"atomic": "",
"array": "",
"map": ""
},
"key": "",
"value": "",
"mappedType": ""
},
"contentTypes": "",
"main": {
Expand Down Expand Up @@ -820,7 +838,8 @@
"unsavedAssets": "",
"runWithoutApplying": "",
"applyAndRun": "",
"cantAddEditor": ""
"cantAddEditor": "",
"loadingPreviouslyOpened": ""
},
"assetViewer": {
"root": "",
Expand Down Expand Up @@ -1151,7 +1170,10 @@
"RepeatingTexture": "",
"SpritedCounter": "",
"TextBox": "",
"BitmapText": ""
"BitmapText": "",
"ScrollBox": "",
"Select": "",
"ItemList": ""
},
"nineSliceTop": "",
"nineSliceRight": "",
Expand All @@ -1165,7 +1187,13 @@
"isUi": "To use u.time or u.timeUi",
"defaultCount": "A label for a field that sets how many sprites are shown when no value has been set through code.",
"useBitmapText": "",
"errorBitmapNotConfigured": ""
"errorBitmapNotConfigured": "",
"layoutItemsHeading": "",
"horizontalPadding": "",
"verticalPadding": "",
"horizontalSpacing": "",
"verticalSpacing": "",
"alignItems": ""
},
"assetInput": {
"changeAsset": "",
Expand Down Expand Up @@ -1403,7 +1431,6 @@
"settings": "",
"sounds": "",
"strings": "",
"styles": "",
"templates": "",
"utilities": "",
"actions": "",
Expand Down Expand Up @@ -1693,7 +1720,14 @@
"delete from storage": "",
"load from storage": "",
"is key in storage": "",
"owning room": ""
"owning room": "",
"x prev": "",
"y prev": "",
"content type entries": "",
"action value": "",
"is action pressed": "",
"is action down": "",
"is action released": ""
},
"blockDisplayNames": {
"write": "",
Expand Down Expand Up @@ -1781,10 +1815,22 @@
"blockDocumentation": {
"serialize object": "",
"constant string": ""
}
},
"globalVariables": "",
"globalVariablesHint": "",
"createNewGlobalVariable": "",
"newGlobalVariablePrompt": "",
"invalidVarNameError": "",
"renamePropertyPrompt": "",
"renameVariablePrompt": "",
"renamingAcrossProject": ""
},
"regionalLinks": {
"discord": "",
"telegram": ""
},
"enumEditor": {
"addVariant": "",
"enumUseCases": ""
}
}
}
Loading

0 comments on commit 24c30eb

Please sign in to comment.