Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

function moving_west(this_sprite) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "West");

function spinning_right(this_sprite) {

turn(this_sprite, 6, "right");

function growing(this_sprite) {

changePropBy(this_sprite, "scale", 1);

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, getProp(this_sprite, "speed"));

if (isTouchingEdges(this_sprite)) {

edgesDisplace(this_sprite);

changePropBy(this_sprite, "direction", 180);

}
}

function moving_east(this_sprite) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "East");

function moving_north(this_sprite) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "North");

function patrolling(this_sprite) {

moveForward(this_sprite, getProp(this_sprite, "speed"));

if (isTouchingEdges(this_sprite)) {

edgesDisplace(this_sprite);

changePropBy(this_sprite, "direction", 180);

if (getProp(this_sprite, "direction") > 270 || getProp(this_sprite,


"direction") < 90) {

mirrorSprite(this_sprite, "right");

} else {

mirrorSprite(this_sprite, "left");

}
}

function moving_south(this_sprite) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "South");

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 jittering(this_sprite) {

changePropBy(this_sprite, "scale", math_random_int(-1, 1));

function wandering(this_sprite) {

withPercentChance(20, function () {

changePropBy(this_sprite, "direction", math_random_int(-25, 25));


});

moveForward(this_sprite, getProp(this_sprite, "speed"));

if (isTouchingEdges(this_sprite)) {

edgesDisplace(this_sprite);

changePropBy(this_sprite, "direction", math_random_int(135, 225));

if (getProp(this_sprite, "direction") > 270 || getProp(this_sprite,


"direction") < 90) {

mirrorSprite(this_sprite, "right");

} else {

mirrorSprite(this_sprite, "left");

function shrinking(this_sprite) {

changePropBy(this_sprite, "scale", -1);

function spinning_left(this_sprite) {

turn(this_sprite, 6, "left");

}
function moving_with_arrow_keys(this_sprite) {

if (isKeyPressed("up")) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "North");

if (isKeyPressed("down")) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "South");

if (isKeyPressed("left")) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "West");

if (isKeyPressed("right")) {

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "East");

function driving_with_arrow_keys(this_sprite) {

if (isKeyPressed("up")) {

moveForward(this_sprite, getProp(this_sprite, "speed"));

if (isKeyPressed("down")) {

moveBackward(this_sprite, getProp(this_sprite, "speed"));

if (isKeyPressed("left")) {
changePropBy(this_sprite, "direction", -5);

changePropBy(this_sprite, "rotation", -5);

if (isKeyPressed("right")) {

changePropBy(this_sprite, "direction", 5);

changePropBy(this_sprite, "rotation", 5);

if (isTouchingEdges(this_sprite)) {

edgesDisplace(this_sprite);

function fluttering(this_sprite) {

changePropBy(this_sprite, "y", math_random_int(-1, 1));

function wobbling(this_sprite) {

withPercentChance(50, function () {

setProp(this_sprite, "rotation", math_random_int(-1, 1));

});

function moving_west_and_looping(this_sprite) {
mirrorSprite(this_sprite, "left");

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "West");

if (getProp(this_sprite, "x") < -50) {

setProp(this_sprite, "x", 450);

function moving_east_and_looping(this_sprite) {

mirrorSprite(this_sprite, "right");

moveInDirection(this_sprite, getProp(this_sprite, "speed"), "East");

if (getProp(this_sprite, "x") > 450) {

setProp(this_sprite, "x", -50);

playSound('sound://category_background/fantasy.mp3');

setBackground('#3366ff');

makeNewSpriteAnon("animation_1", ({"x":200,"y":200}));

setProp(({costume: "animation_1"}), "scale", 380);

spriteClicked("when", ({costume: "animation_1"}), function (extraArgs) {

if (countByAnimation(({costume: "animation_2"})) == countByAnimation(({costume:


"animation_3"}))) {
makeNewSpriteAnon("animation_2", locationMouse());

playSound('sound://category_swish/fast_swish.mp3');

} else {

makeNewSpriteAnon("animation_3", locationMouse());

playSound('sound://category_swish/deep_swish_1.mp3');

});

keyPressed("when", "o", function () {

makeNewSpriteAnon("animation_2", locationMouse());

playSound('sound://category_points/vibrant_game_cartoon_musical_bling_1.mp3');

});

keyPressed("when", "x", function () {

makeNewSpriteAnon("animation_3", undefined);

playSound('sound://category_collect/retro_game_coin_pickup_13.mp3');

});
OK

You might also like