Hypothetical Game Engine

Wick’s coding has a very bad problem: “Red Tape”.

What does that mean?

Wick clearly wants to hide things that are “too hard” from its users, and we want to extract more from Wick, causing really weird syntax to appear once you step outside the “Comfort Zone of Wick Coding” (CZWC):

  • Changing the color of a path in a clip:
// First child only, what about every thing?
// CSS Colors... Really?
ClipName._children[0].fillColor = "red";
  • Getting all clips in a frame to stop:
# This is really, really weird...
project.activeFrame.clips.forEach( (clip) => { clip.stop(); });

Why not:

  • Changing the color of a path in a clip
var finder = new Wick.Finder(this);

Wick.Util.bulkChange(finder.paths, "fillColor", "red");
  • Getting all clips in a frame to stop:
var finder = new Wick.Finder(project);
// $ is for the finder version
Wick.Util.bulkCall(finder.$currentFrames.clips, "stop");
  • Make a “Clip Factory”:
class Player() extends Wick.Prefab {
  constructor(props) {
    super(props);
    this.id = props.id || 0;
    this.displayName = props.displayName || `Player ${props.id || 0}`;
  }
  load() {
    console.log(`Player ${this.displayName} (${this.id}) created`);
  }
  update() {
    // Gamepad Support + Velocity-Based Movement
    this.addVelocity(project.controls.moveX * project.controls.speedUp, project.controls.moveY * project.controls.speedUp);
    this.displayAnim("walk");
    if (project.controls.moveLine < .1)  {
      this.displayAnim("idle");
    }
  }
}

SO what you’re saying is that, if it doesn’t be supported on wick, it doesn’t work?

No, just that it’s harder to do those things.

1 Like