Skip to content

Commit

Permalink
Merge branch 'master' into kiki-lee-lab-2
Browse files Browse the repository at this point in the history
  • Loading branch information
kiki-lee authored Feb 19, 2025
2 parents 0d75e01 + a5ab180 commit 69dee7f
Show file tree
Hide file tree
Showing 12 changed files with 54 additions and 27 deletions.
2 changes: 0 additions & 2 deletions docs/concepts/bouncing-burger.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Bouncing Burger

[Open this tutorial in the editor!](/#tutorial:/concepts/bouncing-burger)

## {Introduction @unplugged}

``||sprites:Sprites||`` can be given ``||sprites:x||`` and ``||sprites:y||`` velocities so that they can move around the screen. In this case, a ``||sprites:Sprite||`` will be used to represent a burger that bounces around the screen.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/picnic-food.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Picnic Food

[Open this tutorial in the editor!](/#tutorial:/concepts/picnic-food)

## {Introduction @unplugged}

``||sprites:Sprites||`` can be placed in different locations around the screen. This is done by setting their ``||sprites:x||`` and ``||sprites:y||`` positions.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/princess-pizza.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Princess Pizza

[Open this tutorial in the editor!](/#tutorial:/concepts/princess-pizza)

## {Introduction @unplugged}

``||sprites:Sprites||`` that are moving will often have situations where two sprites end up on top of each other. The ``||sprites:sprite overlap||`` event can be used to handle interactions between ``||sprites:sprites||`` when this occurs.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/setting-the-scene.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Setting the Scene

[Open this tutorial in the editor!](/#tutorial:/concepts/setting-the-scene)

## {Introduction @unplugged}

The maps and levels in a game are important to make the game interesting to explore. ``||scene:Tilemaps||`` are used to create maps for the player to explore, which can even be set to prevent the player from moving past certain points.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/sunday-drive.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Sunday Drive

[Open this tutorial in the editor!](/#tutorial:/concepts/sunday-drive)

## {Introduction @unplugged}

Games often need actions to occur repeatedly - enemies and collectibles need to be created, winning conditions need to be checked, and so on. The ``||game:on game update interval||`` event allows you to set code to run on a set time period, so that it will occur repeatedly.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/throw-a-bone.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Throw a Bone

[Open this tutorial in the editor!](/#tutorial:/concepts/throw-a-bone)

## {Introduction @unplugged}

Setting up ``||sprites:Sprites||`` can get a bit complicated, with a number of different blocks. ``||sprites:Projectiles||`` are special ``||sprites:Sprites||`` that are made to move across the screen and simplify these sorts of behaviors for you.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/walking-hero.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Walking Hero

[Open this tutorial in the editor!](/#tutorial:/concepts/walking-hero)

## {Introduction @unplugged}

``||sprites:Sprites||`` can be used to represent the **characters** in your game. These can be anything - coins to collect, enemies to avoid, or lasers fired from a spaceship.
Expand Down
2 changes: 0 additions & 2 deletions docs/concepts/which-button.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Which Button?

[Open this tutorial in the editor!](/#tutorial:/concepts/which-button)

## {Introduction @unplugged}

The ``||info:Info||`` category has a number of properties that help handle common behaviors in games. By default, these properties show up on screen as soon as they are set, allowing for an easy way to give the people playing your game information about how well they are doing.
Expand Down
2 changes: 1 addition & 1 deletion docs/index-ref.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"appref": "v1.12.58"
"appref": "v1.12.59"
}
41 changes: 40 additions & 1 deletion editor/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,13 @@ namespace pxt.editor {

paramValues.forEach(value => {
let oldVariableName = "";

const handlerVarShadow = getShadow(value, "variables_get_reporter");

if (!handlerVarShadow) {
return;
}

const connectedVarBlock = getChildBlock(value, "variables_get");

if (connectedVarBlock) {
Expand All @@ -101,7 +108,6 @@ namespace pxt.editor {
value.removeChild(connectedVarBlock);
}

const handlerVarShadow = getShadow(value, "variables_get_reporter");
const handlerVarField = getField(handlerVarShadow, "VAR");
const argReporterName = handlerVarField.textContent;
oldVariableName = oldVariableName || argReporterName;
Expand Down Expand Up @@ -295,6 +301,39 @@ namespace pxt.editor {
.forEach(node => node.setAttribute("name", "height"));
}
}

if (pxt.semver.strcmp(pkgTargetVersion || "0.0.0", "1.0.0") < 0) {
// At some point Sprite.z switched from being a getter/setter to a property
pxt.U.toArray(dom.querySelectorAll("block[type=Sprite_blockCombine_set]>field[name=property]"))
.forEach(node => {
if (node.textContent.trim() === "Sprite.z@set") {
node.textContent = "Sprite.z";
}
});


// The kind field used by the legacy animation editor switched to including the numerical
// enum value in the field (e.g. Walking -> 0Walking)
const actionKinds = pxt.U.toArray(dom.querySelectorAll("variable[type=ActionKind]"));

if (actionKinds.length) {
pxt.U.toArray(dom.querySelectorAll("block[type=action_enum_shim]>field[name=MEMBER]"))
.concat(pxt.U.toArray(dom.querySelectorAll("shadow[type=action_enum_shim]>field[name=MEMBER]")))
.forEach(node => {
const value = node.textContent;
if (!/^\d/.test(value)) {
// The correct numerical value will be in the variables
for (const kind of actionKinds) {
const match = /^\d+(.*)/.exec(kind.textContent);
if (match?.[1] === value) {
node.textContent = kind.textContent;
break;
}
}
}
});
}
}
}

function swapFieldIfNotMatching(
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pxt-arcade",
"version": "2.0.10",
"version": "2.0.17",
"description": "Small arcade editor for MakeCode",
"keywords": [
"JavaScript",
Expand Down Expand Up @@ -31,8 +31,8 @@
"typescript": "4.8.3"
},
"dependencies": {
"pxt-common-packages": "12.2.2",
"pxt-core": "11.3.13"
"pxt-common-packages": "12.2.3",
"pxt-core": "11.3.21"
},
"optionalDependencies": {
"pxt-arcade-sim": "microsoft/pxt-arcade-sim.git#v0.11.12"
Expand Down
16 changes: 10 additions & 6 deletions pxtarget.json
Original file line number Diff line number Diff line change
Expand Up @@ -569,16 +569,17 @@
"availableLocales": [
"en",
"ar",
"zh-CN",
"zh-TW",
"de",
"es-ES",
"es-MX",
"fr",
"ga-IE",
"it",
"ja",
"ko",
"es-ES",
"es-MX",
"ru"
"ru",
"zh-CN",
"zh-TW"
],
"invertedMenu": true,
"showHomeScreen": true,
Expand Down Expand Up @@ -678,7 +679,10 @@
"hideReplaceMyCode": true,
"timeMachine": true,
"timeMachineDiffInterval": 600000,
"timeMachineSnapshotInterval": 1800000
"timeMachineSnapshotInterval": 1800000,
"feedbackEnabled": true,
"ocvAppId": 50315,
"ocvFrameUrl": "https://admin-ignite.microsoft.com"
},
"queryVariants": {
"skillsMap=1": {
Expand Down

0 comments on commit 69dee7f

Please sign in to comment.