1
0
Fork 0

Moved global var declarations to main.js to be shared with game

master
Mike Gerwitz 2012-03-21 00:38:25 -04:00
parent 22b99b9405
commit fe2dbcac19
2 changed files with 26 additions and 7 deletions

25
scripts/main.js 100644
View File

@ -0,0 +1,25 @@
/**
* Common declarations
*
* Copyright (C) 2012 Mike Gerwitz
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
window.ltjs = {};
window.Class = easejs.Class;
window.Interface = easejs.Interface;
// alert the user on all uncaught errors
window.onerror = alert;

View File

@ -77,13 +77,6 @@
<script src="../scripts/ease.min.js"></script> <script src="../scripts/ease.min.js"></script>
<script> <script>
window.ltjs = {};
window.Class = easejs.Class;
window.Interface = easejs.Interface;
// alert the user on all uncaught errors
window.onerror = alert;
var ctx = document.getElementById( 'canvas' ).getContext( '2d' ), var ctx = document.getElementById( 'canvas' ).getContext( '2d' ),
ctxmap = document.getElementById( 'canvas_map' ).getContext( '2d' ), ctxmap = document.getElementById( 'canvas_map' ).getContext( '2d' ),
ltg = document.getElementById( 'ltg' ), ltg = document.getElementById( 'ltg' ),
@ -254,6 +247,7 @@
// invoke immediately, as we may have a filename prefilled from a refresh // invoke immediately, as we may have a filename prefilled from a refresh
ltgChange(); ltgChange();
</script> </script>
<script src="../scripts/main.js"></script>
<script src="../lib/TileDfn.js"></script> <script src="../lib/TileDfn.js"></script>
<script src="../lib/ClassicTileDfn.js"></script> <script src="../lib/ClassicTileDfn.js"></script>
<script src="../lib/LtgLoader.js"></script> <script src="../lib/LtgLoader.js"></script>