Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by DaveVoyles

I'm receiving the error listed above when I attempt to launch my game from the browser from Chrome. I'm not sure of what this is telling me, however.

When launching from IE, I receive this error:

SCRIPT1004: Expected ';'
game.min.js, line 529 character 338

There must be an issue with my baking, but I'm unsure of how to correct it. Where do you think I should go from here?

The URL to my game can be found here:
https://dl.dropboxusercontent.com/u/3152642/Super%20Rawr%20Type/Shooter/index.html

And my baking script looks like this:

@echo off



:: Path to impact.js and your game's main .js

SET IMPACT_LIBRARY=lib\impact\impact.js
SET GAME=lib\game\main.js

:: Output file
SET OUTPUT_FILE=game.min.js




:: Change CWD to Impact's base dir and bake!
cd C:/wamp/www/Shooter/

C:\wamp\bin\php\php5.3.13\php.exe tools/bake.php %IMPACT_LIBRARY% %GAME% %OUTPUT_FILE%

pause

1 decade ago by Joncom

This is only just a hunch, however...

JavaScript is an interesting language because you do not actually need to put a semi-colon at the end of each statement.

// without semi-colon
var foo = 'bar' // valid
var abs = 123 // valid
// with semi-colon
var hi = 'hello'; // also valid
var bye = 'goodbye'; // also valid

However, when you bake a game, what it essenstially does is move all the lines onto a single line. And I suspect if you do not properly add a semi-colon to the end of each line, you will get an error such as Expected ';'

So the solution (maybe) is to add ; to the end of every line in your code.

Edit

I am using SublimeText 2 as my text editor, and it seems to automatically notice when I miss a semi-colon and it highlights it so I know to add one there.

1 decade ago by DaveVoyles

I use Visual Studio, with a number of extensions, and I&039;m anal about adding those ";" at the end of the line. (I come from a c background).

Your guess is what I initially thought as well! I'm curious as to what would draw this error...

1 decade ago by Graphikos

The line its crashing on is part of the engine itself. I assume you didn't alter the engine's code at all so the error reporting must be incorrect and the problem is elsewhere.

Baking doesn't do much to the actual source other than minifiying it. Semicolons in javascript are "optional" but when you minifiy they become very important unless the bake function can add them in while it's removing whitespace. shrugs

You might have to systematically remove parts of your game and then try to bake it. See if you can narrow down where the issue may be.
Page 1 of 1
« first « previous next › last »