title: There's no Gameloop in my P5js with Angular
body: <p>I am currently evaluating a Framework / Possibility to create a Game inside of an Angular Application. I have tried Canvas, now I want to use P5.</p>
  <p>The Problem is, that it runs the whole draw function <strong>just once</strong>.</p>
  <pre><code>
  ngOnInit(): void {
      this.scrWidth = window.innerWidth;
      this.scrHeight = window.innerHeight;
  
      this.createCanvas();
    }
  
    private createCanvas() {
      const sketch = (s: p5) =&gt; {
        s.preload = () =&gt; {};
  
        s.setup = () =&gt; {
          s.frameRate(30);
          s.createCanvas(this.scrWidth, this.scrHeight - 10);
          s.background(50);
  
          this.objLayer = new ObjectLayer();
  
          this.player = new Player(
            this.scrHeight / 20, // Width (Using the screen height to scale the player)
            (this.scrHeight / 20) * 1.5, // Height (Using the screen height to scale the player)
            30, // X Starting Position
            30 // Y Starting Position
          );
          this.objLayer.children.push(this.player);
        };
  
        s.draw = () =&gt; {
          this.update(); //Updating states, coordinates, ..
          this.render(); // Drawing Objects to the sketch
        };
      };
  
      this.p5 = new p5(sketch.bind(this), this.container.nativeElement);
    }
  </code></pre>
  <p>I don't know if Angular is blocking the loop in someway, or if I just made a mistake. unfortunately, there's <strong>almost no help</strong> on the internet for <strong>using P5.js with Angular/Typescript</strong>.</p>
  <p>I am very thankful for any ideas.</p>