Jump to content

uncaught Type Error


Recommended Posts

hello with this code I am getting an Uncuaght TypeError: undefined is not valid at appt.ts line 3. Thanks for the help.


(function () {    var myGame = new Phaser.Game(this, 'game', 800, 600, null, create, update);Uncaught TypeError: undefined is not a function    var circle: Phaser.GeomSprite;    var floor: Phaser.GeomSprite;    function create() {        circle = myGame.createGeomSprite(200, 0);        circle.createCircle(64);        circle.acceleration.y = 100;        circle.elasticity = 0.8;        //  A simple floor        floor = myGame.createGeomSprite(0, 550);        floor.createRectangle(800, 50);        floor.immovable = true;    }    function update() {        myGame.collide(circle, floor);    }})();


<!DOCTYPE html><html lang="en"><head>    <meta charset="utf-8" />    <title>TypeScript HTML App</title>    <link rel="stylesheet" href="app.css" type="text/css" />    <script type="text/javascript" src="src/Phaser/phaser.js"></script>    <script src="app.js"></script></head><body>    <h1>TypeScript HTML App</h1>    <div id="content"></div></body></html>


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

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