Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
fedf56d
add rudimentary support for sensing_askandwait and sensing_answer
Feb 10, 2026
546eb51
add comments to StaticFuncRegistry and items
Feb 11, 2026
3918b0a
fix stage dimensions to 480x360
Feb 11, 2026
77cc1be
display questions over stage, and using bubbles when appropriate
Feb 11, 2026
34dbd50
disable automplete on askandwait input
Feb 11, 2026
486fd62
make ProjectRunner a bit nicer by making it a class and EventTarget
pufferfish101007 Feb 12, 2026
740db39
implement event_whenthisspriteclicked
pufferfish101007 Feb 13, 2026
86ec4c1
add hat blocks to implemented opcode list
pufferfish101007 Feb 13, 2026
561e936
looks_nextcostume: loop to beginning once end is reached
pufferfish101007 Feb 13, 2026
814a5ef
add backdrop switching
pufferfish101007 Feb 13, 2026
75943a8
Gracefully tear down setup when navigation occurs
pufferfish101007 Feb 13, 2026
71be336
add variable show/hide blocks
pufferfish101007 Feb 13, 2026
41dab0a
consider that `project_json.monitors` might not exist
pufferfish101007 Feb 13, 2026
9d3bce7
respect yielding condition when generating inlined next step (fixes #52)
pufferfish101007 Feb 14, 2026
64770b6
fixup proc calls in all nested steps (fixes #53)
pufferfish101007 Feb 14, 2026
fd95706
add test fixtures for #52 & #53
pufferfish101007 Feb 14, 2026
9b3e52a
implement control_stop all
pufferfish101007 Feb 14, 2026
c9c63a4
remove unneeded info from `IrMonitor`
pufferfish101007 Feb 15, 2026
5e9dc8d
lt/gt: try to convert strings to numbers first
pufferfish101007 Feb 15, 2026
4780e38
consider in const folding that variables may be overwritten in loop b…
pufferfish101007 Feb 15, 2026
e6334eb
implement control_for_each
pufferfish101007 Feb 15, 2026
d7a6dd6
consider that projects may have faield to compile when unmounting player
pufferfish101007 Feb 15, 2026
2e1625a
add mousedown, mousex, mousey
pufferfish101007 Feb 17, 2026
5393844
implement operator_round
pufferfish101007 Feb 17, 2026
7536e29
allow calling nonexistent procedures as noop
pufferfish101007 Feb 17, 2026
8d9a61a
avoid creating dummy steps in `generate_if_else` where possible
pufferfish101007 Feb 17, 2026
342a4d7
add costume name block
pufferfish101007 Feb 18, 2026
5391b80
compile project in webworker to avoid hanging the main thread
pufferfish101007 Feb 18, 2026
e96ba99
add data_itemnumoflist
pufferfish101007 Feb 18, 2026
ba979e2
show dev banner on top with high z index
pufferfish101007 Feb 18, 2026
83e8f11
format
pufferfish101007 Feb 18, 2026
4aca3a4
update vite config to allow wasm imports in workers
pufferfish101007 Feb 18, 2026
5c1c407
add get/set/change x/y pos blocks
pufferfish101007 Feb 18, 2026
fb5ff49
fix typo
pufferfish101007 Feb 18, 2026
033c083
fix some problems with control_stop all
pufferfish101007 Feb 18, 2026
d512fd0
small fixes surrounding loops in optimisation
pufferfish101007 Feb 24, 2026
0b49163
rename variable for clarity
pufferfish101007 Feb 24, 2026
a7ab803
fix proc argument regex for if argument at start of proccode
pufferfish101007 Feb 24, 2026
e8882cd
add motion_movesteps
pufferfish101007 Feb 24, 2026
96034d4
add pen_changePenColorParamBy
pufferfish101007 Feb 24, 2026
f1f1b64
implement data_listcontainsitem
pufferfish101007 Feb 24, 2026
5cdff6f
format
pufferfish101007 Feb 24, 2026
28caf9d
try not to eagerly clear type stack in SSA
pufferfish101007 Feb 24, 2026
7f41830
lint
pufferfish101007 Feb 24, 2026
ef196e0
start changing SSA stack impl
pufferfish101007 Feb 26, 2026
1668f12
persist SSA stack nicely, even across branches
pufferfish101007 Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions js/data/update_var_val_boolean.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { update_var_val } from "../shared.ts";

export function update_var_val_boolean(val: boolean, id: string) {
update_var_val(id, val);
}
5 changes: 5 additions & 0 deletions js/data/update_var_val_float.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { update_var_val } from "../shared.ts";

export function update_var_val_float(val: number, id: string) {
update_var_val(id, val);
}
5 changes: 5 additions & 0 deletions js/data/update_var_val_int.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { update_var_val } from "../shared.ts";

export function update_var_val_int(val: number, id: string) {
update_var_val(id, val);
}
5 changes: 5 additions & 0 deletions js/data/update_var_val_string.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { update_var_val } from "../shared.ts";

export function update_var_val_string(val: string, id: string) {
update_var_val(id, val);
}
5 changes: 5 additions & 0 deletions js/data/update_var_visible.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { update_var_visible as update_var_visibility } from "../shared.ts";

export function update_var_visible(id: string, visible: boolean) {
update_var_visibility(id, visible);
}
8 changes: 8 additions & 0 deletions js/looks/switchbackdropto.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { renderer, costumes, target_skins, stageIndex } from "../shared";

export function switchbackdropto(costume_num: number) {
console.log("switch backdrop to", costume_num);
console.log(stageIndex(), costumes());
const costume = costumes()[stageIndex()][costume_num];
renderer().getSkin(target_skins()[stageIndex()][0]).setSVG(costume.data);
}
3 changes: 3 additions & 0 deletions js/sensing/queue_ask.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import { queue_question } from "../shared";

export const queue_ask = queue_question;
53 changes: 52 additions & 1 deletion js/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,40 @@ let _renderer: object;
let _pen_skin: number;
let _target_skins: Array<[number, number]>;
let _costumes: Array<Array<Costume>>;
let _queue_question: (question: string, struct: object) => void = () => {};
let _stageIndex: number;
let _update_var_val: (id: string, val: any) => void = () => {};
let _update_var_visible: (id: string, visible: boolean) => void = () => {};

type Costume = {
data: string;
dataFormat: string;
};

export function unsetup() {
_target_names = null;
_target_bubbles = null;
_renderer = null;
_pen_skin = null;
_target_skins = null;
_costumes = null;
_queue_question = () => {};
_stageIndex = null;
_update_var_val = () => {};
_update_var_visible = () => {};
_setup = false;
}

export function setup(
target_names: Array<string>,
renderer: object,
pen_skin: number,
target_skins: Array<[number, number]>,
costumes: Array<Array<Costume>>,
queue_question: (question: string, struct: object) => void,
stageIndex: number,
update_var_val: (id: string, val: any) => void,
update_var_visible: (id: string, visible: boolean) => void,
) {
_target_names = target_names;
_target_bubbles = _target_names.map((_) => null);
Expand All @@ -25,6 +47,10 @@ export function setup(
_pen_skin = pen_skin;
_target_skins = target_skins;
_costumes = costumes;
_queue_question = queue_question;
_stageIndex = stageIndex;
_update_var_val = update_var_val;
_update_var_visible = update_var_visible;
_setup = true;
}

Expand Down Expand Up @@ -63,20 +89,30 @@ export function costumes(): Array<Array<Costume>> {
return _costumes;
}

export function stageIndex(): number {
check_setup();
return _stageIndex;
}

export function update_bubble(
target_index: number,
verb: "say" | "think",
text: string,
) {
check_setup();
if (!_target_bubbles[target_index]) {
if (!_target_bubbles[target_index] && text !== "") {
_target_bubbles[target_index] = _renderer.createSkin(
"text",
"sprite",
verb,
text,
false,
);
} else if (text == "") {
if (!_target_bubbles[target_index]) return;
_renderer.destroyDrawable(_target_bubbles[target_index][1], "sprite");
_renderer.destroySkin(_target_bubbles[target_index][0]);
_target_bubbles[target_index] = null;
} else {
_renderer.updateTextSkin(
_target_bubbles[target_index][0],
Expand All @@ -86,3 +122,18 @@ export function update_bubble(
);
}
}

export function queue_question(question: string, struct: object) {
check_setup();
_queue_question(question, struct);
}

export function update_var_val(id: string, val: any) {
check_setup();
_update_var_val(id, val);
}

export function update_var_visible(id: string, visible: boolean) {
check_setup();
_update_var_visible(id, visible);
}
5 changes: 5 additions & 0 deletions opcodes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ const opcodes = [
.match(/BlockOpcode::[a-zA-Z_0-9]+? (?==>)/g)
.map((op) => op.replace("BlockOpcode::", "").trim()),
),
"event_whenflagclicked",
"event_whenbroadcastreceived",
"event_whenthisspriteclicked",
"event_whenstageclicked",
"procedures_definition",
].sort();
await writeFile(
"/tmp/hq-build/js/opcodes.js",
Expand Down
1 change: 1 addition & 0 deletions playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ main {
position: sticky;
top: 5px;
background-color: var(--color-background);
z-index: 999;
}
</style>

Expand Down
Loading
Loading