Versionsvergleich
Aus ProgrammingWiki
Vergleich: 2019-11-02T14:43:51+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. |
| − | So eine Grundlagen nutzen Programmierer oft, um wiederkehrende Funktionen nicht immer neu implementieren zu müssen. Man spricht dabei auch von "Bibliotheken". |
| − | </p> |
| − | <br/> |
| − | |
| − | <code id="Game"> |
| − | function Game(canvas, width, height) { |
| − | |
| − | this.canvas = canvas; |
| − | this.width = width; |
| − | this.height = height; |
| − | |
| − | function test() { |
| − | this.canvas.setColor(100, 100, 100); |
| − | this.canvas.fillRect(0, 0, this.width / 2, this.height / 2); |
| − | } |
| − | } |
| − | </code> |