Versionsvergleich

Aus ProgrammingWiki

Vergleich: 2019-09-08T09:02:27+00:00 → 2019-11-23T14:15:49+00:00

<language>Javascript</language>
−
−
----
−
<p>Eine Game-Engine repräsentiert eine Grundlage, auf der man Spiele entwickelt. Für meine Games im Wiki binde ich diese Engine ein.</p>
−
<br/>
−
−
<code id="Game">
−
class Game {
−
−
  constructor(canvas, width, height) {
−
    this.canvas = canvas;
−
    this.width = width;
−
    this.height = height;
−
  }
−
−
  setBackground(r, g, b) {
−
    this.canvas.setColor(r, g, b);
−
    this.canvas.fillRect(0, 0, width, height);
−
  }
−
−
  setBackground(color) {
−
    this.canvas.setColor(color);
−
    this.canvas.fillRect(0, 0, width, height);
−
  }
−
−
}
−
−
}
−
</code>