简体   繁体   中英

Why is my isometric map code not being called?

I'm building an isometric map like the one done by Christian Weber .

I've got nearly identical code to his, but the JS function building the map is never getting called. It should be, since I have $('div#map').gameMap({map:[[{"tile":"grass_0","object":""},... in the $(document).ready(function() {} like he does in his demo's source code.

Here's a JSFiddle showing my attempt: http://jsfiddle.net/briz/RWgge/6/

I only need 1 map, and it doesn't need to be as big as the one given in the code, but for the purpose of trying to make the map work, I've kept it the same large map as he gives.

Can someone understand why my gameMap func is not being called?

Your code is in the wrong order -- you need to load the plugin before you create a class using it, and you need to create an instance of the class after you've created the class.

Is this what you wanted?

http://jsfiddle.net/mblase75/RWgge/8/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM