Skip to content

Instantly share code, notes, and snippets.

@0xf0f0f0
Last active December 7, 2020 13:41
Show Gist options
  • Select an option

  • Save 0xf0f0f0/b54ddeb58b8a82f5cd919fa1c1954d8f to your computer and use it in GitHub Desktop.

Select an option

Save 0xf0f0f0/b54ddeb58b8a82f5cd919fa1c1954d8f to your computer and use it in GitHub Desktop.
const delay = (game, delay = 1) => game.add.tween(this)
.to({}, delay, null, true).onComplete;
const makeText = (game, props, anchor = {x: .5, y: .5}) => {
const {value, styles} = props;
const {x, y} = anchor;
const text = game.make.text(0, 0, value, styles);
text.anchor.set(x, y);
return text;
};
const createCurtain = (game, color, alpha) => {
const graphics = game.make.graphics();
graphics.beginFill(color, alpha);
graphics.drawRect(0, 0, 960, 960);
graphics.endFill();
return graphics;
};
export {
delay, createCurtain,
makeText
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment