diff --git a/.vscode/settings.json b/.vscode/settings.json index 31b5dc16..2100726d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -6,6 +6,7 @@ "files.trimTrailingWhitespace": true, "files.insertFinalNewline": true, "cSpell.words": [ + "anims", "audiotrack", "autorun", "autoscroll", @@ -80,6 +81,7 @@ "Tahoma", "timelapse", "ttyv", + "tweens", "uglifyjs", "umount", "unlisten", diff --git a/locales/de/translation.json b/locales/de/translation.json index 9d861566..a859f2cc 100644 --- a/locales/de/translation.json +++ b/locales/de/translation.json @@ -116,6 +116,7 @@ "BLOCKS_PHASER_ON_PRELOAD": "beim Vorausladen", "BLOCKS_PHASER_ON_RENDER": "beim Rendern", "BLOCKS_PHASER_ON_UPDATE": "bei Aktualisierung", + "BLOCKS_PHASER_INPUT_LOGIC": "Eingabe Logik", "BLOCKS_PHASER_OPEN_FILE_LIBRARY": "Öffne Datei Bibliothek", "BLOCKS_PHASER_PHYSICS_ARCADE_ENABLE": "verwende Arcade Physik für", "BLOCKS_PHASER_PHYSICS_SPRITE": "Physics Sprite", @@ -143,6 +144,10 @@ "BLOCKS_PHASER_TIME_EVENT": "nach", "BLOCKS_PHASER_TIME_LOOP_EVENT": "wiederhole alle", "BLOCKS_PHASER_UPDATE": "Aktualisieren", + "BLOCKS_PHASER_VARIABLE_TEXT": "Text", + "BLOCKS_PHASER_VARIABLE_GROUP": "Gruppe", + "BLOCKS_PHASER_VARIABLE_INPUT": "Eingabe", + "BLOCKS_PHASER_VARIABLE_SPRITE": "Sprite", "BLOCKS_PHASER_WITH_THE_SIZE": "mit der Größe", "BLOCKS_PHASER_WORLD": "Welt", "BLOCKS_PHASER_WORLD_ARCADE_PHYSICS": "Welt Arcade-Physik", @@ -240,6 +245,11 @@ "SELECT_PROJECT_TO_OPEN": "Wähle ein Projekt zum Öffnen aus", "SELECT_SCREEN_SUBTITLE": "Eine pädagogische und webbasierte Entwicklerumgebung", "SELECT_SCREEN_TITLE": "Willkomen zu Coding with Chrome!", + "SELECT_SCREEN.EXPERIMENTAL.TITLE": "Experimentelle Version", + "SELECT_SCREEN.EXPERIMENTAL.DESCRIPTION": "Diese Version befindet sich noch in der Entwicklung, ist nicht voll funktionsfähig und kann Fehler enthalten.", + "SELECT_SCREEN.UPDATE.TITLE": "Update verfügbar", + "SELECT_SCREEN.UPDATE.DESCRIPTION": "Eine neue Version von Coding with Chrome ist verfügbar. Bitte klicken Sie auf die folgende Aktualisierungsschaltfläche, um die neueste Version zu erhalten.", + "SELECT_SCREEN.UPDATE.BUTTON": "Coding with Chrome aktualisieren", "SELECT_YOUR_LANGUAGE": "Wähle deine Sprache aus", "SORT_BY_DATE": "Sortieren nach Datum", "SORT_BY_NAME": "Sortieren nach Name", diff --git a/locales/en/translation.json b/locales/en/translation.json index 79f25636..a6d403a0 100644 --- a/locales/en/translation.json +++ b/locales/en/translation.json @@ -79,6 +79,7 @@ "BLOCKS_PHASER_DEBUG_POINTER": "debug pointer", "BLOCKS_PHASER_DEBUG_SPRITE": "debug sprite", "BLOCKS_PHASER_DYNAMIC_TEXT_ADD_HIGHSCORE": "as highscore", + "BLOCKS_PHASER_INPUT_LOGIC": "Input Logic", "BLOCKS_PHASER_EXAMPLE_FILES": "Example Files", "BLOCKS_PHASER_EXAMPLE_FILES_BACKGROUND": "Backgroud Images", "BLOCKS_PHASER_EXAMPLE_FILES_BALL": "Ball Images", @@ -144,6 +145,10 @@ "BLOCKS_PHASER_TIME_LOOP_EVENT": "repeat every", "BLOCKS_PHASER_UPDATE": "Update", "BLOCKS_PHASER_WITH_THE_SIZE": "with the size", + "BLOCKS_PHASER_VARIABLE_TEXT": "Text", + "BLOCKS_PHASER_VARIABLE_GROUP": "Group", + "BLOCKS_PHASER_VARIABLE_INPUT": "Input", + "BLOCKS_PHASER_VARIABLE_SPRITE": "Sprite", "BLOCKS_PHASER_WORLD": "World", "BLOCKS_PHASER_WORLD_ARCADE_PHYSICS": "world arcade physics", "BLOCKS_PHASER_WORLD_ARCADE_PHYSICS_CHANGE": "change world arcade physics", @@ -250,6 +255,11 @@ "START_FROM_LEFT": "start from left", "START_FROM_RIGHT": "start from right", "START_FROM_TOP": "start from top", + "SELECT_SCREEN.EXPERIMENTAL.TITLE": "Experimental Version", + "SELECT_SCREEN.EXPERIMENTAL.DESCRIPTION": "This version is still in development, not fully functional and may contain errors.Use at your own risk.", + "SELECT_SCREEN.UPDATE.TITLE": "Update available", + "SELECT_SCREEN.UPDATE.DESCRIPTION": "A new version of Coding with Chrome is available. Please click the following update button to get the latest version.", + "SELECT_SCREEN.UPDATE.BUTTON": "Update Coding with Chrome", "TILE_POSITION_X": "tile position x", "TILE_POSITION_Y": "tile position y", "TOP": "top", diff --git a/package-lock.json b/package-lock.json index 6bab1018..7dc01c75 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2812,9 +2812,9 @@ } }, "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", - "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", "dev": true, "engines": { "node": ">=6.0.0" @@ -3497,9 +3497,9 @@ "dev": true }, "node_modules/@remix-run/router": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.0.tgz", - "integrity": "sha512-HOil5aFtme37dVQTB6M34G95kPM3MMuqSmIRVCC52eKV+Y/tGSqw9P3rWhlAx6A+mz+MoX+XxsGsNJbaI5qCgQ==", + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.15.1.tgz", + "integrity": "sha512-zcU0gM3z+3iqj8UX45AmWY810l3oUmXM7uH4dt5xtzvMhRtYVhKGOmgOd1877dOPPepfCjUv57w+syamWIYe7w==", "dev": true, "engines": { "node": ">=14.0.0" @@ -3636,9 +3636,9 @@ "dev": true }, "node_modules/@sindresorhus/merge-streams": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.2.0.tgz", - "integrity": "sha512-UTce8mUwUW0RikMb/eseJ7ys0BRkZVFB86orHzrfW12ZmFtym5zua8joZ4L7okH2dDFHkcFjqnZ5GocWBXOFtA==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/@sindresorhus/merge-streams/-/merge-streams-2.2.1.tgz", + "integrity": "sha512-255V7MMIKw6aQ43Wbqp9HZ+VHn6acddERTLiiLnlcPLU9PdTq9Aijl12oklAgUEblLWye+vHLzmqBx6f2TGcZw==", "dev": true, "engines": { "node": ">=18" @@ -4111,9 +4111,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.11.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.17.tgz", - "integrity": "sha512-QmgQZGWu1Yw9TDyAP9ZzpFJKynYNeOvwMJmaxABfieQoVoiVOS6MN1WSpqpRcbeA5+RW82kraAVxCCJg+780Qw==", + "version": "20.11.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.19.tgz", + "integrity": "sha512-7xMnVEcZFu0DikYjWOlRq7NTPETrm7teqUT2WkQjrTIkEgUyyGdWsj/Zg8bEJt5TNklzbPD1X3fqfsHw3SpapQ==", "dev": true, "dependencies": { "undici-types": "~5.26.4" @@ -4153,9 +4153,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.2.55", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.55.tgz", - "integrity": "sha512-Y2Tz5P4yz23brwm2d7jNon39qoAtMMmalOQv6+fEFt1mT+FcM3D841wDpoUvFXhaYenuROCy3FZYqdTjM7qVyA==", + "version": "18.2.56", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.2.56.tgz", + "integrity": "sha512-NpwHDMkS/EFZF2dONFQHgkPRwhvgq/OAvIaGQzxGSBmaeR++kTg6njr15Vatz0/2VcCEwJQFi6Jf4Q0qBu0rLA==", "dev": true, "dependencies": { "@types/prop-types": "*", @@ -4641,9 +4641,9 @@ } }, "node_modules/@uiw/codemirror-extensions-basic-setup": { - "version": "4.21.21", - "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.21.21.tgz", - "integrity": "sha512-+0i9dPrRSa8Mf0CvyrMvnAhajnqwsP3IMRRlaHDRgsSGL8igc4z7MhvUPn+7cWFAAqWzQRhMdMSWzo6/TEa3EA==", + "version": "4.21.22", + "resolved": "https://registry.npmjs.org/@uiw/codemirror-extensions-basic-setup/-/codemirror-extensions-basic-setup-4.21.22.tgz", + "integrity": "sha512-Lxq2EitQb/MwbNrMHBmVdSIR96WmaICnYBYeZbLUxmr4kQcbrA6HXqNSNZJ0V4ZihPfKnNs9+g87QK0HsadE6A==", "dev": true, "dependencies": { "@codemirror/autocomplete": "^6.0.0", @@ -4668,16 +4668,16 @@ } }, "node_modules/@uiw/react-codemirror": { - "version": "4.21.21", - "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.21.21.tgz", - "integrity": "sha512-PaxBMarufMWoR0qc5zuvBSt76rJ9POm9qoOaJbqRmnNL2viaF+d+Paf2blPSlm1JSnqn7hlRjio+40nZJ9TKzw==", + "version": "4.21.22", + "resolved": "https://registry.npmjs.org/@uiw/react-codemirror/-/react-codemirror-4.21.22.tgz", + "integrity": "sha512-VmxU9oRXwcleG2u5Ui2xVXaLVPL8cBuRN3vA41hlu4OQ/ftJb+4p+dBd6bZ+NJKSXm3LufbPGzu8oKwNO4tG4A==", "dev": true, "dependencies": { "@babel/runtime": "^7.18.6", "@codemirror/commands": "^6.1.0", "@codemirror/state": "^6.1.1", "@codemirror/theme-one-dark": "^6.0.0", - "@uiw/codemirror-extensions-basic-setup": "4.21.21", + "@uiw/codemirror-extensions-basic-setup": "4.21.22", "codemirror": "^6.0.0" }, "funding": { @@ -5091,12 +5091,6 @@ "node": ">= 8" } }, - "node_modules/arg": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz", - "integrity": "sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==", - "dev": true - }, "node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -5653,9 +5647,9 @@ } }, "node_modules/blockly": { - "version": "10.3.1", - "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.3.1.tgz", - "integrity": "sha512-EuHeCtcFJgTjHRktIL9I9S6/Dnd+AnjkSzMf79sQMrH47pZYSWGC2SZlgHIJve2JnY79D1W9ijMgjEyrgtbFnA==", + "version": "10.4.1", + "resolved": "https://registry.npmjs.org/blockly/-/blockly-10.4.1.tgz", + "integrity": "sha512-FcAnMU4/uJkOiY3p3OISDfko8iXFlEIF52L2l1EclShkLuC+igW670Q2I+RXhjIyWRA9Lv08BCQLWuGXlsAlKw==", "dev": true, "dependencies": { "jsdom": "22.1.0" @@ -5747,9 +5741,9 @@ } }, "node_modules/browserslist": { - "version": "4.22.3", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.3.tgz", - "integrity": "sha512-UAp55yfwNv0klWNapjs/ktHoguxuQNGnOzxYmfnXIS+8AsRDZkSDxg7R1AX3GKzn078SBI5dzwzj/Yx0Or0e3A==", + "version": "4.23.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.23.0.tgz", + "integrity": "sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==", "dev": true, "funding": [ { @@ -5766,8 +5760,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001580", - "electron-to-chromium": "^1.4.648", + "caniuse-lite": "^1.0.30001587", + "electron-to-chromium": "^1.4.668", "node-releases": "^2.0.14", "update-browserslist-db": "^1.0.13" }, @@ -5913,9 +5907,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001587", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001587.tgz", - "integrity": "sha512-HMFNotUmLXn71BQxg8cijvqxnIAofforZOwGsxyXJ0qugTdspUF4sPSJ2vhgprHCB996tIDzEq1ubumPDV8ULA==", + "version": "1.0.30001588", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz", + "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==", "dev": true, "funding": [ { @@ -7714,9 +7708,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.4.668", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.668.tgz", - "integrity": "sha512-ZOBocMYCehr9W31+GpMclR+KBaDZOoAEabLdhpZ8oU1JFDwIaFY0UDbpXVEUFc0BIP2O2Qn3rkfCjQmMR4T/bQ==", + "version": "1.4.673", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.673.tgz", + "integrity": "sha512-zjqzx4N7xGdl5468G+vcgzDhaHkaYgVcf9MqgexcTqsl2UHSCmOj/Bi3HAprg4BZCpC7HyD8a6nZl6QAZf72gw==", "dev": true }, "node_modules/email-addresses": { @@ -7726,9 +7720,9 @@ "dev": true }, "node_modules/emoji-picker-react": { - "version": "4.7.17", - "resolved": "https://registry.npmjs.org/emoji-picker-react/-/emoji-picker-react-4.7.17.tgz", - "integrity": "sha512-EFilP1vwT3T3ke50Jfz/udq1TpUdcEIDu43wKsMVvSPMUVPi1OPkmKr4qA6+N60qvq/fYxxLWA3jikXEbcNS4A==", + "version": "4.7.18", + "resolved": "https://registry.npmjs.org/emoji-picker-react/-/emoji-picker-react-4.7.18.tgz", + "integrity": "sha512-ZYTUl9KdSFfrdmPmAhcVwSv6/fBuhIw6LxqOJ8jz5min8sezjEArGs25LGjf6VABNE4895HBsuJ5uVKIb0lJuw==", "dev": true, "dependencies": { "flairup": "0.0.38" @@ -10127,9 +10121,9 @@ } }, "node_modules/http-proxy-agent": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.1.tgz", - "integrity": "sha512-My1KCEPs6A0hb4qCVzYp8iEvA8j8YqcvXLZZH8C9OFuTYpYjHE7N2dtG3mRl1HMD4+VGXpF3XcDVcxGBT7yDZQ==", + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", "dev": true, "dependencies": { "agent-base": "^7.1.0", @@ -10197,19 +10191,10 @@ "node": ">=10.17.0" } }, - "node_modules/hyperdyperid": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/hyperdyperid/-/hyperdyperid-1.2.0.tgz", - "integrity": "sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==", - "dev": true, - "engines": { - "node": ">=10.18" - } - }, "node_modules/i18next": { - "version": "23.8.2", - "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.8.2.tgz", - "integrity": "sha512-Z84zyEangrlERm0ZugVy4bIt485e/H8VecGUZkZWrH7BDePG6jT73QdL9EA1tRTTVVMpry/MgWIP1FjEn0DRXA==", + "version": "23.8.3", + "resolved": "https://registry.npmjs.org/i18next/-/i18next-23.8.3.tgz", + "integrity": "sha512-IQn6Tfn+XkIRHjC/z3uQSGLhsRC6Y14kgyrsgoPqnFD9MqbNt2B9MF3Ch4p114pEVPQ2qktE2nd0aYr7UxRLKA==", "dev": true, "funding": [ { @@ -12422,12 +12407,15 @@ } }, "node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.1.0.tgz", + "integrity": "sha512-p3cz0JV5vw/XeouBU3Ldnp+ZkBjE+n8ydJ4mcwBrOiXXPqNlrzGBqWs9X4MWF7f+iKUBu794Y8Hh8yawiJbCjw==", "dev": true, "engines": { "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/antonk52" } }, "node_modules/lines-and-columns": { @@ -12480,26 +12468,12 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true, - "peer": true - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", "integrity": "sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==", "dev": true }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true, - "peer": true - }, "node_modules/lodash.memoize": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/lodash.memoize/-/lodash.memoize-4.1.2.tgz", @@ -12638,13 +12612,12 @@ } }, "node_modules/memfs": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.7.0.tgz", - "integrity": "sha512-FGbf9Yz2gzXCUmpymkKnzAQOitriZQlIMtmnzb2LOcT0FTUdzL6AAwNGQrSOACx/UiW7XQsG65vrIA9+L01Edw==", + "version": "4.7.6", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-4.7.6.tgz", + "integrity": "sha512-PMxcVnZYdSFYZIzsbhd8XLvxrHaIarhyyfDQHThUwhAYAPDfDTvKhEjWbzPyGFr9CPvJJl+VUetfcnVVF9Wckg==", "dev": true, "dependencies": { - "json-joy": "^11.0.0", - "thingies": "^1.11.1" + "tslib": "^2.0.0" }, "engines": { "node": ">= 4.0.0" @@ -12652,51 +12625,6 @@ "funding": { "type": "github", "url": "https://github.com/sponsors/streamich" - }, - "peerDependencies": { - "tslib": "2" - } - }, - "node_modules/memfs/node_modules/json-joy": { - "version": "11.28.0", - "resolved": "https://registry.npmjs.org/json-joy/-/json-joy-11.28.0.tgz", - "integrity": "sha512-WTq2tYD2r+0rUFId4gtUjwejV20pArh4q2WRJKxJdwLlPFHyW94HwwB2vUr5lUJTVkehhhWEVLwOUI0MSacNIw==", - "dev": true, - "dependencies": { - "arg": "^5.0.2", - "hyperdyperid": "^1.2.0", - "thingies": "^1.14.1" - }, - "bin": { - "jj": "bin/jj.js", - "json-pack": "bin/json-pack.js", - "json-pack-test": "bin/json-pack-test.js", - "json-patch": "bin/json-patch.js", - "json-patch-test": "bin/json-patch-test.js", - "json-pointer": "bin/json-pointer.js", - "json-pointer-test": "bin/json-pointer-test.js", - "json-unpack": "bin/json-unpack.js" - }, - "engines": { - "node": ">=10.0" - }, - "funding": { - "url": "https://github.com/sponsors/streamich" - }, - "peerDependencies": { - "quill-delta": "^5", - "rxjs": "7", - "tslib": "2" - } - }, - "node_modules/memfs/node_modules/rxjs": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.1.tgz", - "integrity": "sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==", - "dev": true, - "peer": true, - "dependencies": { - "tslib": "^2.1.0" } }, "node_modules/merge-descriptors": { @@ -16185,9 +16113,9 @@ } }, "node_modules/pac-proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.3.tgz", - "integrity": "sha512-kCnwztfX0KZJSLOBrcL0emLeFako55NWMovvyPP2AjsghNk9RB1yjSI+jVumPHYZsNXegNoqupSW9IY3afSH8w==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, "dependencies": { "agent-base": "^7.0.2", @@ -17206,9 +17134,9 @@ } }, "node_modules/proxy-agent/node_modules/https-proxy-agent": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.3.tgz", - "integrity": "sha512-kCnwztfX0KZJSLOBrcL0emLeFako55NWMovvyPP2AjsghNk9RB1yjSI+jVumPHYZsNXegNoqupSW9IY3afSH8w==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.4.tgz", + "integrity": "sha512-wlwpilI7YdjSkWaQ/7omYBMTliDcmCN8OLihO6I9B86g06lMyAoqgoDpV0XqoaPOKj+0DIdAvnsWfyAAhmimcg==", "dev": true, "dependencies": { "agent-base": "^7.0.2", @@ -17370,21 +17298,6 @@ "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", "dev": true }, - "node_modules/quill-delta": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/quill-delta/-/quill-delta-5.1.0.tgz", - "integrity": "sha512-X74oCeRI4/p0ucjb5Ma8adTXd9Scumz367kkMK5V/IatcX6A0vlgLgKbzXWy5nZmCGeNJm2oQX0d2Eqj+ZIlCA==", - "dev": true, - "peer": true, - "dependencies": { - "fast-diff": "^1.3.0", - "lodash.clonedeep": "^4.5.0", - "lodash.isequal": "^4.5.0" - }, - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -17616,12 +17529,12 @@ } }, "node_modules/react-router": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.22.0.tgz", - "integrity": "sha512-q2yemJeg6gw/YixRlRnVx6IRJWZD6fonnfZhN1JIOhV2iJCPeRNSH3V1ISwHf+JWcESzLC3BOLD1T07tmO5dmg==", + "version": "6.22.1", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-6.22.1.tgz", + "integrity": "sha512-0pdoRGwLtemnJqn1K0XHUbnKiX0S4X8CgvVVmHGOWmofESj31msHo/1YiqcJWK7Wxfq2a4uvvtS01KAQyWK/CQ==", "dev": true, "dependencies": { - "@remix-run/router": "1.15.0" + "@remix-run/router": "1.15.1" }, "engines": { "node": ">=14.0.0" @@ -17631,13 +17544,13 @@ } }, "node_modules/react-router-dom": { - "version": "6.22.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.22.0.tgz", - "integrity": "sha512-z2w+M4tH5wlcLmH3BMMOMdrtrJ9T3oJJNsAlBJbwk+8Syxd5WFJ7J5dxMEW0/GEXD1BBis4uXRrNIz3mORr0ag==", + "version": "6.22.1", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.22.1.tgz", + "integrity": "sha512-iwMyyyrbL7zkKY7MRjOVRy+TMnS/OPusaFVxM2P11x9dzSzGmLsebkCvYirGq0DWB9K9hOspHYYtDz33gE5Duw==", "dev": true, "dependencies": { - "@remix-run/router": "1.15.0", - "react-router": "6.22.0" + "@remix-run/router": "1.15.1", + "react-router": "6.22.1" }, "engines": { "node": ">=14.0.0" @@ -18110,9 +18023,9 @@ "dev": true }, "node_modules/sass": { - "version": "1.70.0", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.70.0.tgz", - "integrity": "sha512-uUxNQ3zAHeAx5nRFskBnrWzDUJrrvpCPD5FNAoRvTi0WwremlheES3tg+56PaVtCs5QDRX5CBLxxKMDJMEa1WQ==", + "version": "1.71.0", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.71.0.tgz", + "integrity": "sha512-HKKIKf49Vkxlrav3F/w6qRuPcmImGVbIXJ2I3Kg0VMA+3Bav+8yE9G5XmP5lMj6nl4OlqbPftGAscNaNu28b8w==", "dev": true, "dependencies": { "chokidar": ">=3.0.0 <4.0.0", @@ -18800,9 +18713,9 @@ } }, "node_modules/streamx": { - "version": "2.15.8", - "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.15.8.tgz", - "integrity": "sha512-6pwMeMY/SuISiRsuS8TeIrAzyFbG5gGPHFQsYjUr/pbBadaL1PCWmzKw+CHZSwainfvcF6Si6cVLq4XTEwswFQ==", + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.16.0.tgz", + "integrity": "sha512-a7Fi0PoUeusrUcMS4+HxivnZqYsw2MFEP841TIyLxTcEIucHcJsk+0ARcq3tGq1xDn+xK7sKHetvfMzI1/CzMA==", "dev": true, "dependencies": { "fast-fifo": "^1.1.0", @@ -19332,9 +19245,9 @@ } }, "node_modules/terser": { - "version": "5.27.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.0.tgz", - "integrity": "sha512-bi1HRwVRskAjheeYl291n3JC4GgO/Ty4z1nVs5AAsmonJulGxpSektecnNedrwK9C7vpvVtcX3cw00VSLt7U2A==", + "version": "5.27.1", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.27.1.tgz", + "integrity": "sha512-29wAr6UU/oQpnTw5HoadwjUZnFQXGdOfj0LjZ4sVxzqwHh/QVkvr7m8y9WoR4iN3FRitVduTc6KdjcW38Npsug==", "dev": true, "dependencies": { "@jridgewell/source-map": "^0.3.3", @@ -19451,18 +19364,6 @@ "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, - "node_modules/thingies": { - "version": "1.16.0", - "resolved": "https://registry.npmjs.org/thingies/-/thingies-1.16.0.tgz", - "integrity": "sha512-J23AVs11hSQxuJxvfQyMIaS9z1QpDxOCvMkL3ZxZl8/jmkgmnNGWrlyNxVz6Jbh0U6DuGmHqq6f7zUROfg/ncg==", - "dev": true, - "engines": { - "node": ">=10.18" - }, - "peerDependencies": { - "tslib": "^2" - } - }, "node_modules/third-party-web": { "version": "0.24.1", "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.24.1.tgz", @@ -19698,16 +19599,17 @@ } }, "node_modules/typed-array-byte-offset": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.0.tgz", - "integrity": "sha512-RD97prjEt9EL8YgAgpOkf3O4IF9lhJFr9g0htQkm0rchFp/Vx7LW5Q8fSXXub7BXAODyUQohRMyOc3faCPd0hg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/typed-array-byte-offset/-/typed-array-byte-offset-1.0.1.tgz", + "integrity": "sha512-tcqKMrTRXjqvHN9S3553NPCaGL0VPgFI92lXszmrE8DMhiDPLBYLlvo8Uu4WZAAX/aGqp/T1sbA4ph8EWjDF9Q==", "dev": true, "dependencies": { - "available-typed-arrays": "^1.0.5", - "call-bind": "^1.0.2", + "available-typed-arrays": "^1.0.6", + "call-bind": "^1.0.7", "for-each": "^0.3.3", + "gopd": "^1.0.1", "has-proto": "^1.0.1", - "is-typed-array": "^1.1.10" + "is-typed-array": "^1.1.13" }, "engines": { "node": ">= 0.4" @@ -20114,9 +20016,9 @@ } }, "node_modules/webpack": { - "version": "5.90.1", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.1.tgz", - "integrity": "sha512-SstPdlAC5IvgFnhiRok8hqJo/+ArAbNv7rhU4fnWGHNVfN59HSQFaxZDSAL3IFG2YmqxuRs+IU33milSxbPlog==", + "version": "5.90.2", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.90.2.tgz", + "integrity": "sha512-ziXu8ABGr0InCMEYFnHrYweinHK2PWrMqnwdHk2oK3rRhv/1B+2FnfwYv5oD+RrknK/Pp/Hmyvu+eAsaMYhzCw==", "dev": true, "dependencies": { "@types/eslint-scope": "^3.7.3", @@ -20296,9 +20198,9 @@ } }, "node_modules/webpack-dev-server": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.1.tgz", - "integrity": "sha512-Mbla51FSVfk9WvGiCWRJLsMLq87LNxQitz477z0LIhHbx7ig/fIkU9R/OCNmf6A3tTaJoObwmYco9buC1oN+yA==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/webpack-dev-server/-/webpack-dev-server-5.0.2.tgz", + "integrity": "sha512-IVj3qsQhiLJR82zVg3QdPtngMD05CYP/Am+9NG5QSl+XwUR/UPtFwllRBKrMwM9ttzFsC6Zj3DMgniPyn/Z0hQ==", "dev": true, "dependencies": { "@types/bonjour": "^3.5.13", diff --git a/package.json b/package.json index 19d03b44..9280516d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coding-with-chrome", - "version": "10.3.3", + "version": "10.4.0", "description": "Educational Coding Development Environment", "repository": { "type": "git", diff --git a/src/components/GameEditor/blocks/ArcadePhysicsBlocks.js b/src/components/GameEditor/blocks/ArcadePhysicsBlocks.js index b43a9b89..2296f7b5 100644 --- a/src/components/GameEditor/blocks/ArcadePhysicsBlocks.js +++ b/src/components/GameEditor/blocks/ArcadePhysicsBlocks.js @@ -675,7 +675,7 @@ javascriptGenerator.forBlock['phaser_physics_arcade_enable'] = function ( 'variable', javascriptGenerator.ORDER_ATOMIC, ); - return 'this.physics.world.enable(' + value_variable + ');\n'; + return `this.physics.world.enable(${value_variable});\n`; }; /** @@ -761,15 +761,9 @@ javascriptGenerator.forBlock['phaser_physics_arcade_overlap'] = function ( javascriptGenerator.ORDER_ATOMIC, ); const statements_code = javascriptGenerator.statementToCode(block, 'CODE'); - return ( - 'this.physics.overlap(' + - value_object1 + - ', ' + - value_object2 + - ', function(object1, object2) {\n' + - statements_code + - '}, null, this);\n' - ); + return `this.physics.add.overlap(${value_object1}, ${value_object2}, function(object1, object2, collisionInfo) { + ${statements_code} + }, null, this);\n`; }; /** @@ -808,7 +802,5 @@ javascriptGenerator.forBlock['phaser_physics_arcade_collide'] = function ( 'object2', javascriptGenerator.ORDER_ATOMIC, ); - return ` - this.physics.add.collider(${object1}, ${object2}); - `; + return `this.physics.add.collider(${object1}, ${object2});\n`; }; diff --git a/src/components/GameEditor/blocks/AudioBlocks.js b/src/components/GameEditor/blocks/AudioBlocks.js index 0049d85e..861737d2 100644 --- a/src/components/GameEditor/blocks/AudioBlocks.js +++ b/src/components/GameEditor/blocks/AudioBlocks.js @@ -145,7 +145,7 @@ javascriptGenerator.forBlock['phaser_audio_add'] = function (block) { ); return ` ${variable} = this.sound.add('${textAudio}', { - volume: ${numberVolume}, loop: ${dropdownLoop} + volume: ${numberVolume / 100}, loop: ${dropdownLoop} });`; }; diff --git a/src/components/GameEditor/blocks/CreateBlocks.js b/src/components/GameEditor/blocks/CreateBlocks.js index b4afd058..cef44f44 100644 --- a/src/components/GameEditor/blocks/CreateBlocks.js +++ b/src/components/GameEditor/blocks/CreateBlocks.js @@ -59,6 +59,9 @@ javascriptGenerator.forBlock['phaser_create'] = function (block) { // Helper function to simplify blocks. this.helper_ = new PhaserHelper(this); + // Default definition for easier access. + this.default_group = this.add.group(undefined, 'default_group'); + ${javascriptGenerator.statementToCode(block, 'CODE')} }`; }; diff --git a/src/components/GameEditor/blocks/GameBlocks.js b/src/components/GameEditor/blocks/GameBlocks.js index 229ab6a5..65fbae5e 100644 --- a/src/components/GameEditor/blocks/GameBlocks.js +++ b/src/components/GameEditor/blocks/GameBlocks.js @@ -37,11 +37,15 @@ Blocks['phaser_game'] = { BlocksHelper.validateText, ), 'name', - ) + ); + this.appendDummyInput() + .appendField(BlocksTemplate.adjust()) .appendField(i18next.t('BLOCKS_PHASER_WITH_THE_SIZE')) .appendField(new Blockly.FieldNumber(400, 0, 5760), 'width') .appendField('x') - .appendField(new Blockly.FieldNumber(600, 0, 2160), 'height'); + .appendField(new Blockly.FieldNumber(600, 0, 2160), 'height') + .appendField('Enable Debug') + .appendField(new Blockly.FieldCheckbox(false), 'debug'); this.setNextStatement(true, 'Game_State'); this.setColour(75); this.setTooltip(''); @@ -73,7 +77,7 @@ javascriptGenerator.forBlock['phaser_game'] = function (block) { physics: { default: 'arcade', arcade: { - debug: false + debug: ${block.getFieldValue('debug') == 'TRUE'} } } } diff --git a/src/components/GameEditor/blocks/GeneratorBlocks.js b/src/components/GameEditor/blocks/GeneratorBlocks.js index e3de5cd1..220b8608 100644 --- a/src/components/GameEditor/blocks/GeneratorBlocks.js +++ b/src/components/GameEditor/blocks/GeneratorBlocks.js @@ -110,30 +110,30 @@ Blocks['phaser_generator_vertical_obstacle'] = { ); this.appendValueInput('obstacles') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('NUMBER_OF_OBSTACLES')); this.appendValueInput('spaces') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('NUMBER_OF_SPACES')); this.appendValueInput('x') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('x'); this.appendValueInput('y') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('y'); this.appendValueInput('sprite_top') .setCheck('String') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('SPRITE_TOP')); this.appendValueInput('sprite_bottom') .setCheck('String') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('SPRITE_BOTTOM')); this.appendValueInput('group') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('BLOCKS_GROUP')); this.appendStatementInput('CODE').setCheck('GeneratorArcadeAttribute'); this.setInputsInline(false); @@ -243,25 +243,25 @@ Blocks['phaser_generator_random_vertical_obstacle'] = { ); this.appendValueInput('obstacles') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('NUMBER_OF_OBSTACLES')); this.appendValueInput('x') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('x'); this.appendValueInput('y') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('y'); this.appendValueInput('sprite_optional') .setCheck('String') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('SPRITE_OPTIONAL')); this.appendValueInput('group') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('BLOCKS_GROUP')); this.appendDummyInput() - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('DIRECTION')) .appendField( new Blockly.FieldDropdown([ @@ -364,18 +364,18 @@ Blocks['phaser_generator_matrix_block'] = { ); this.appendValueInput('x') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('x'); this.appendValueInput('y') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField('y'); this.appendValueInput('padding') .setCheck('Number') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('BLOCKS_PADDING')); this.appendValueInput('group') - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(i18next.t('BLOCKS_GROUP')); this.appendDummyInput() .appendField(' ') diff --git a/src/components/GameEditor/blocks/TileSpriteBlocks.js b/src/components/GameEditor/blocks/TileSpriteBlocks.js index 02e56ba1..17f782da 100644 --- a/src/components/GameEditor/blocks/TileSpriteBlocks.js +++ b/src/components/GameEditor/blocks/TileSpriteBlocks.js @@ -375,19 +375,19 @@ Blocks['phaser_tile_sprite_crop'] = { .appendField(i18next.t('BLOCKS_PHASER_TILE_SPRITE_CROP')); this.appendDummyInput() .appendField(i18next.t('TOP')) - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(new Blockly.FieldNumber(0, 0), 'top'); this.appendDummyInput() .appendField(i18next.t('RIGHT')) - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(new Blockly.FieldNumber(0, 0), 'right'); this.appendDummyInput() .appendField(i18next.t('BOTTOM')) - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(new Blockly.FieldNumber(0, 0), 'bottom'); this.appendDummyInput() .appendField(i18next.t('LEFT')) - .setAlign(Blockly.ALIGN_RIGHT) + .setAlign(Blockly.inputs.Align.RIGHT) .appendField(new Blockly.FieldNumber(0, 0), 'left'); this.setPreviousStatement(true, 'Create'); this.setNextStatement(true, 'Create'); diff --git a/src/components/GameEditor/blocks/VariableBlocks.js b/src/components/GameEditor/blocks/VariableBlocks.js index 0ceea571..f094f03b 100644 --- a/src/components/GameEditor/blocks/VariableBlocks.js +++ b/src/components/GameEditor/blocks/VariableBlocks.js @@ -25,12 +25,38 @@ import { javascriptGenerator } from 'blockly/javascript'; import { BlocksHelper } from './BlocksHelper'; +import i18next from 'i18next'; + const reservedPhaserVariables = [ - 'preload', + 'add', + 'anims', + 'cache', + 'cameras', + 'children', 'create', - 'update', - 'render', + 'data', + 'default_group', + 'events', 'game', + 'helper_', + 'input', + 'lights', + 'load', + 'make', + 'physics', + 'plugins', + 'preload', + 'registry', + 'render', + 'renderer', + 'scale', + 'scene', + 'sound', + 'sys', + 'textures', + 'time', + 'tweens', + 'update', ]; /** @@ -105,7 +131,7 @@ javascriptGenerator.forBlock['phaser_variable_get'] = function (block) { Blocks['phaser_variable_group_set'] = { init: function () { this.appendDummyInput() - .appendField('Group') + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_GROUP')) .appendField(new Blockly.FieldTextInput('default'), 'VAR'); this.setOutput(true, null); this.setColour(330); @@ -140,7 +166,7 @@ javascriptGenerator.forBlock['phaser_variable_group_set'] = function (block) { Blocks['phaser_variable_group_get'] = { init: function () { this.appendDummyInput() - .appendField('Group') + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_GROUP')) .appendField( new Blockly.FieldDropdown(() => { return BlocksHelper.phaserVariable( @@ -170,3 +196,147 @@ javascriptGenerator.forBlock['phaser_variable_group_get'] = function (block) { : 'this.' + block.getFieldValue('VAR'); return [variable, javascriptGenerator.ORDER_ATOMIC]; }; + +/** + * Set dynamic text variable + */ +Blocks['phaser_variable_text_set'] = { + init: function () { + this.appendDummyInput() + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_TEXT')) + .appendField(new Blockly.FieldTextInput('default'), 'VAR'); + this.setOutput(true, null); + this.setColour(330); + this.setTooltip(''); + this.setHelpUrl(''); + this.setOnChange(() => { + const variableName = this.getFieldValue('VAR'); + if (reservedPhaserVariables.includes(variableName)) { + this.setWarningText('Reserved variable name.'); + } else { + this.setWarningText(null); + } + }); + }, +}; + +/** + * Set dynamic text variable + * @param {Block} block + * @return {string} + */ +javascriptGenerator.forBlock['phaser_variable_text_set'] = function (block) { + const variable = block.getFieldValue('VAR').startsWith('this') + ? block.getFieldValue('VAR') + : 'this.' + block.getFieldValue('VAR'); + return [variable, javascriptGenerator.ORDER_ATOMIC]; +}; + +/** + * Get dynamic text variable + */ +Blocks['phaser_variable_text_get'] = { + init: function () { + this.appendDummyInput() + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_TEXT')) + .appendField( + new Blockly.FieldDropdown(() => { + return BlocksHelper.phaserVariable( + this, + 'phaser_variable_text_set', + 'default_text', + 'default_text', + ); + }), + 'VAR', + ); + this.setOutput(true, null); + this.setColour(330); + this.setTooltip(''); + this.setHelpUrl(''); + }, +}; + +/** + * Get dynamic text variable + * @param {Block} block + * @return {string} + */ +javascriptGenerator.forBlock['phaser_variable_text_get'] = function (block) { + const variable = block.getFieldValue('VAR').startsWith('this') + ? block.getFieldValue('VAR') + : 'this.' + block.getFieldValue('VAR'); + return [variable, javascriptGenerator.ORDER_ATOMIC]; +}; + +/** + * Set dynamic sprite variable + */ +Blocks['phaser_variable_sprite_set'] = { + init: function () { + this.appendDummyInput() + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_SPRITE')) + .appendField(new Blockly.FieldTextInput('default'), 'VAR'); + this.setOutput(true, null); + this.setColour(330); + this.setTooltip(''); + this.setHelpUrl(''); + this.setOnChange(() => { + const variableName = this.getFieldValue('VAR'); + if (reservedPhaserVariables.includes(variableName)) { + this.setWarningText('Reserved variable name.'); + } else { + this.setWarningText(null); + } + }); + }, +}; + +/** + * Set dynamic sprite variable + * @param {Block} block + * @return {string} + */ +javascriptGenerator.forBlock['phaser_variable_sprite_set'] = function (block) { + const variable = block.getFieldValue('VAR').startsWith('this') + ? block.getFieldValue('VAR') + : 'this.' + block.getFieldValue('VAR'); + return [variable, javascriptGenerator.ORDER_ATOMIC]; +}; + +/** + * Get dynamic sprite variable + */ +Blocks['phaser_variable_sprite_get'] = { + init: function () { + this.appendDummyInput() + .appendField(i18next.t('BLOCKS_PHASER_VARIABLE_SPRITE')) + .appendField( + new Blockly.FieldDropdown(() => { + return BlocksHelper.phaserVariable( + this, + 'phaser_variable_sprite_set', + 'default_sprite', + 'default_sprite', + ); + }), + 'VAR', + ); + this.setOutput(true, null); + this.setColour(330); + this.setTooltip(''); + this.setHelpUrl(''); + }, +}; + +/** + * Get dynamic sprite variable + * @param {Block} block + * @return {string} + */ +javascriptGenerator.forBlock['phaser_variable_sprite_get'] = function (block) { + const variable = block.getFieldValue('VAR').startsWith('this') + ? block.getFieldValue('VAR') + : 'this.' + block.getFieldValue('VAR'); + return [variable, javascriptGenerator.ORDER_ATOMIC]; +}; diff --git a/src/components/GameEditor/toolbox/AudioToolbox.js b/src/components/GameEditor/toolbox/AudioToolbox.js index 6e5122ce..388a2dc2 100644 --- a/src/components/GameEditor/toolbox/AudioToolbox.js +++ b/src/components/GameEditor/toolbox/AudioToolbox.js @@ -43,7 +43,7 @@ export const createBlocks = [ - sound + sound_effect @@ -61,7 +61,7 @@ export const defaultBlocks = [ - sound + sound_effect `, @@ -72,7 +72,7 @@ export const defaultBlocks = [ - sound + sound_effect `, @@ -83,7 +83,7 @@ export const defaultBlocks = [ - sound + sound_effect `, @@ -94,7 +94,7 @@ export const defaultBlocks = [ - sound + sound_effect `, diff --git a/src/components/GameEditor/toolbox/InputToolbox.js b/src/components/GameEditor/toolbox/InputToolbox.js index 3d122746..953efad1 100644 --- a/src/components/GameEditor/toolbox/InputToolbox.js +++ b/src/components/GameEditor/toolbox/InputToolbox.js @@ -99,7 +99,37 @@ export const createBlocks = [ export const eventBlocks = [ { kind: 'block', - type: 'phaser_input', + blockxml: ` + + + + + + + + spacebar + + + + + + + + + player + + + velocity.y + + + + + + + + + + `, }, { kind: 'block', @@ -177,40 +207,6 @@ export const eventBlocks = [ `, }, - { - kind: 'block', - blockxml: ` - - - - - - - - spacebar - - - - - - - - - player - - - velocity.y - - - - - - - - - - `, - }, { kind: 'block', blockxml: ` diff --git a/src/components/GameEditor/toolbox/TextToolbox.js b/src/components/GameEditor/toolbox/TextToolbox.js index 826aabd9..dc86b299 100644 --- a/src/components/GameEditor/toolbox/TextToolbox.js +++ b/src/components/GameEditor/toolbox/TextToolbox.js @@ -64,7 +64,7 @@ export const createBlocks = [ blockxml: ` - + highscore @@ -84,7 +84,7 @@ export const createBlocks = [ blockxml: ` - + text @@ -106,7 +106,7 @@ export const createBlocks = [ blockxml: ` - + start_text @@ -123,6 +123,56 @@ export const createBlocks = [ `, }, + { + kind: 'block', + blockxml: ` + + #ff0000 + 32px + Arial Black + + + Game Over + + + + + MINUS + + + 1 + + + centerX + + + + + 85 + + + + + + + MINUS + + + 1 + + + centerY + + + + + 32 + + + + + `, + }, ]; /** @@ -134,7 +184,7 @@ export const defaultBlocks = [ blockxml: ` - + text @@ -150,7 +200,7 @@ export const defaultBlocks = [ blockxml: ` - + highscore @@ -160,7 +210,7 @@ export const defaultBlocks = [ - + highscore @@ -180,7 +230,7 @@ export const defaultBlocks = [ blockxml: ` - + text @@ -191,7 +241,7 @@ export const defaultBlocks = [ blockxml: ` - + highscore @@ -208,7 +258,7 @@ export const eventBlocks = [ blockxml: ` - + start_text diff --git a/src/components/GameEditor/toolbox/Toolbox.js b/src/components/GameEditor/toolbox/Toolbox.js index e0e98daf..751621e8 100644 --- a/src/components/GameEditor/toolbox/Toolbox.js +++ b/src/components/GameEditor/toolbox/Toolbox.js @@ -277,60 +277,66 @@ export class Toolbox { container: 'icon_keyboard blocklyTreeRoot', }, expanded: 'false', - contents: InputToolbox.eventBlocks.concat( - InputToolbox.defaultBlocks, - [ - { - kind: 'category', - name: i18next.t('BLOCKS_PHASER_AUDIO'), - colour: '245', - cssConfig: { - container: 'icon_audiotrack blocklyTreeChild', - }, - contents: AudioToolbox.defaultBlocks, - }, - { - kind: 'category', - name: i18next.t('BLOCKS_PHASER_SPRITE'), - colour: '225', - cssConfig: { - container: 'icon_portrait blocklyTreeChild', - }, - contents: SpriteToolbox.defaultBlocks, - }, - { - kind: 'category', - name: i18next.t('BLOCKS_PHASER_TILE_SPRITE'), - colour: '285', - cssConfig: { - container: 'icon_burst_mode blocklyTreeChild', - }, - contents: TileSpriteToolbox.defaultBlocks, - }, - { - kind: 'category', - name: i18next.t('BLOCKS_PHASER_PHYSICS_SPRITE'), - colour: '0', - cssConfig: { - container: 'icon_rotate_90_degrees_ccw blocklyTreeChild', - }, - contents: ArcadePhysicsToolbox.defaultBlocks.concat( - ArcadePhysicsToolbox.eventBlocks, - ), - }, - { - kind: 'category', - name: i18next.t('BLOCKS_PHASER_TEXT'), - colour: '255', - cssConfig: { - container: 'icon_format_shapes blocklyTreeChild', - }, - contents: TextToolbox.eventBlocks.concat( - TextToolbox.defaultBlocks, - ), - }, - ], - ), + contents: InputToolbox.eventBlocks.concat([ + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_INPUT_LOGIC'), + colour: '255', + cssConfig: { + container: 'icon_call_split blocklyTreeChild', + }, + contents: InputToolbox.defaultBlocks, + }, + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_AUDIO'), + colour: '245', + cssConfig: { + container: 'icon_audiotrack blocklyTreeChild', + }, + contents: AudioToolbox.defaultBlocks, + }, + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_SPRITE'), + colour: '225', + cssConfig: { + container: 'icon_portrait blocklyTreeChild', + }, + contents: SpriteToolbox.defaultBlocks, + }, + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_TILE_SPRITE'), + colour: '285', + cssConfig: { + container: 'icon_burst_mode blocklyTreeChild', + }, + contents: TileSpriteToolbox.defaultBlocks, + }, + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_PHYSICS_SPRITE'), + colour: '0', + cssConfig: { + container: 'icon_rotate_90_degrees_ccw blocklyTreeChild', + }, + contents: ArcadePhysicsToolbox.defaultBlocks.concat( + ArcadePhysicsToolbox.eventBlocks, + ), + }, + { + kind: 'category', + name: i18next.t('BLOCKS_PHASER_TEXT'), + colour: '255', + cssConfig: { + container: 'icon_format_shapes blocklyTreeChild', + }, + contents: TextToolbox.eventBlocks.concat( + TextToolbox.defaultBlocks, + ), + }, + ]), }, { kind: 'category', diff --git a/src/components/Preview/Preview.js b/src/components/Preview/Preview.js index 54e4670f..2ec0d472 100644 --- a/src/components/Preview/Preview.js +++ b/src/components/Preview/Preview.js @@ -57,6 +57,7 @@ export class Preview extends React.PureComponent { this.contentWrapper = createRef(); this.contentIframe = createRef(); this.contentLoadTimer = null; + this.previewToolbar = createRef(); window.addEventListener('resize', this.resize.bind(this)); } @@ -151,6 +152,9 @@ export class Preview extends React.PureComponent { ) { console.debug('Iframe Content Loaded:', event); this.setState({ loaded: true, loading: false }); + if (this.previewToolbar.current) { + this.previewToolbar.current.isLoaded(true); + } } } @@ -163,6 +167,9 @@ export class Preview extends React.PureComponent { if (this.contentLoadTimer) { clearTimeout(this.contentLoadTimer); } + if (this.previewToolbar.current) { + this.previewToolbar.current.isLoaded(false); + } } /** @@ -206,6 +213,9 @@ export class Preview extends React.PureComponent { this.contentIframe.current.contentWindow.stop(); this.contentIframe.current.contentWindow.location = 'about:blank'; this.setState({ loaded: false, loading: false }); + if (this.previewToolbar.current) { + this.previewToolbar.current.isLoaded(false); + } } /** @@ -230,6 +240,7 @@ export class Preview extends React.PureComponent { { this.props.preview.updatePreviewLocation(); }} @@ -133,6 +142,7 @@ export class PreviewToolbar extends React.PureComponent { {this.state.loaded && ( { this.props.preview.stop(); }} diff --git a/src/components/SelectScreen/SelectScreen.js b/src/components/SelectScreen/SelectScreen.js index 3aebefcb..9f903681 100644 --- a/src/components/SelectScreen/SelectScreen.js +++ b/src/components/SelectScreen/SelectScreen.js @@ -147,16 +147,18 @@ export class SelectScreen extends React.PureComponent { - Experimental Version - This version is experimental and not fully functional. Use at your - own risk. + + {i18next.t('SELECT_SCREEN.EXPERIMENTAL.TITLE')} + + {i18next.t('SELECT_SCREEN.EXPERIMENTAL.DESCRIPTION')} {this.state.showUpdate && ( - Update available + + {i18next.t('SELECT_SCREEN.UPDATE.TITLE')} + - A new version of Coding with Chrome is available. Please click - the following update button to get the latest version. + {i18next.t('SELECT_SCREEN.UPDATE.DESCRIPTION')} )}