Something
uhhhunknown
plain_text
a year ago
2.5 kB
20
Indexable
var name2;
setBackgroundImageAs("front_of_house_1");
makeNewSpriteAnon("blue_shirt_ball_1", ({"x":150,"y":250}));
setProp(({costume: "blue_shirt_ball_1"}), "scale", 200);
setPrompt('What is your name?', 'name2', function(val) {name2 = val;});
whenPromptAnswered('name2', function (extraArgs) {
printText(textJoin("Hello ", textVariableJoin(name2, '!')));
});
function moving_east(this_sprite) {
mirrorSprite(this_sprite, "right");
moveInDirection(this_sprite, 3, "East");
}
function moving_west(this_sprite) {
mirrorSprite(this_sprite, "left");
moveInDirection(this_sprite, 3, "West");
}
function mystery_behavior(this_sprite) {
changePropBy(this_sprite, "scale", -1);
}
function math_random_int(a, b) {
if (a > b) {
// Swap a and b to ensure a is smaller.
var c = a;
a = b;
b = c;
}
return Math.floor(Math.random() * (b - a + 1) + a);
}
function wandering(this_sprite) {
if (math_random_int(0, 5) == 0) {
changePropBy(this_sprite, "direction", math_random_int(-25, 25));
}
moveForward(this_sprite, 1);
if (isTouchingEdges(this_sprite)) {
edgesDisplace(this_sprite);
changePropBy(this_sprite, "direction", math_random_int(135, 225));
}
}
function running_east(this_sprite) {
moveInDirection(this_sprite, 5, "East");
}
function spinning_left(this_sprite) {
turn(this_sprite, 6, "left");
}
function spinning_right(this_sprite) {
turn(this_sprite, 6, "right");
}
function shrinking(this_sprite) {
changePropBy(this_sprite, "scale", -1);
}
function growing(this_sprite) {
changePropBy(this_sprite, "scale", 1);
}
function moving_south(this_sprite) {
moveInDirection(this_sprite, 5, "South");
}
function swimming_left_and_right(this_sprite) {
if (getProp(this_sprite, "direction") == 0) {
mirrorSprite(this_sprite, "right");
} else if (getProp(this_sprite, "direction") == 180) {
mirrorSprite(this_sprite, "left");
}
moveForward(this_sprite, 5);
if (isTouchingEdges(this_sprite)) {
edgesDisplace(this_sprite);
changePropBy(this_sprite, "direction", 180);
}
}
function moving_north(this_sprite) {
moveInDirection(this_sprite, 5, "North");
}
function jittering(this_sprite) {
changePropBy(this_sprite, "scale", math_random_int(-1, 1));
}
function patrolling(this_sprite) {
moveForward(this_sprite, 5);
if (isTouchingEdges(this_sprite)) {
edgesDisplace(this_sprite);
changePropBy(this_sprite, "direction", 180);
}
}
Editor is loading...
Leave a Comment