0

I am using pixi.js to learn about HTML5 game development. When using this line of code

var bunny = new PIXI

I get an undefined error saying that PIXI isn't defined.

Here is my HTML

<!doctype html>
<head>
    <title>PixiJS</title>
    <meta charset="UTF-8">
</head>

<body>


<script src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/4.2.2/pixi.min.js"></script>
<script src="index.js"></script>
</body>
Jordan Baron
  • 101
  • 2
  • Maybe the pixi script haven't been loaded. Check the console (F12 on chrome) to see if there is any error – renatopp Dec 14 '16 at 14:51

1 Answers1

1

First, check that Pixi is working with:

console.log(PIXI);

If this does not spit out the Pixi object, you will have to google your specific error, or come back here. Since you mention trying to learn, I have to ask, you are running this code on a webserver (local or otherwise), right? The Pixi "Getting Started" tutorial mentions this as a requirement. If you don't have a local server stack (WAMP, XAMPP, MAMP, etc) running, Pixi will not work.

wat
  • 11
  • 1