Jump to content

Function Call TypeError with Socket.io


SirSandmann
 Share

Recommended Posts

Hey Guys,

I have a problem with a function call with Phaser. I am a Javascript Noob and don´t know what I do wrong.

Here is the critical Part of my Code, the whole Code is in one Scene.

BasicGame.Multiplayer.prototype = {create: function(){        this.socket = io.connect('localhost:3010');        this.socket.on('startGame', function () {            console.log('ShouldStartGame');            this.createActualGame();        });...},createActualGame: function(){// Define constants...}}

My problem is that the function this.createActualGame is not called with the error: "TypeError: this.createActualGame is not a function".
But the console log works fine. Thanks for your help!

With kind regards,
SirSandmann

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...