Installation Documentation?

27 views
Skip to first unread message

Daniel Kraft

unread,
Jan 2, 2015, 10:55:15 PM1/2/15
to excal...@googlegroups.com
The installation documentation seems kind of light. I am trying to get the ball rolling on a little game.

Installing from packages wasn't working, I was able to install Excalibur.js after downloading source on github, then installing it with npm. I don't much about node, but thats what I did.

When I try to run, this is the trace of the error I get.

Core.ts:811 Uncaught TypeError: Cannot read property 'style' of null
Core.ts:811 Engine.setHeightByDisplayMode
Core.ts:829 Engine.initialize
Core.ts:633 Engine
game.js:4 (anonymous function)

Line 4 of game.js is just:
var game = new ex.Engine();

What am I doing wrong?

Erik Onarheim

unread,
Jan 2, 2015, 11:42:50 PM1/2/15
to excal...@googlegroups.com
Hi Daniel, 

I'm very excited you are trying out Excalibur and that you found the group! 

I'll definitely agree, our installation documentation could use a little work. (Perhaps more discoverable too?) On that note, this may be of more assistance to you: http://excaliburjs.com/docs/quickstart.html

It appears that you are trying to run Excalibur from within Node, we only have the node npm package as another method of code distribution (I have added an issue to our backlog to clear this up #391). I can definitely see were you can get confused. Excalibur is intended to be run directly in the browser by including it (excalibur.js) in your main html document.

Something like this:

<!-- index.html -->
<html>
<head>
</head>
<body>
   <script src="excalibur-version.js"></script>
   <script src="game.js"></script>
</body>
</html>


<!-- game.js -->
var game = new ex.Engine();
// implement game.....
game.start()


Does this make sense?

Let us know if you run into any problems, feel free to post to our issue tracker :)

Cheers,
Erik

Daniel Kraft

unread,
Jan 3, 2015, 1:03:43 AM1/3/15
to excal...@googlegroups.com
Well, now I feel foolish. 

At first I thought it should be entirely clientside, but after I received that error, I thought that it was because of it not being installed serverside.

I was getting the error because I was including my scripts in the <head>, and not the <body>. :P

Thanks for the answer!
Reply all
Reply to author
Forward
0 new messages