Author Topic: Crafty JS isometric Map drag and drop  (Read 708 times)

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Crafty JS isometric Map drag and drop
« on: December 14, 2011, 02:28:23 AM »
Hi all,

aim actually trying to implement CraftyJS in my Game. CraftyJS has many Tutorials how to create Isometric maps, but most of them are not usable because it generates a Random map or the Whole map is loaded at start. I want to load the Map over ajax but only the Tiles, which are in range of my player.

I was able to Initialize the Map at Start this Code iam using

Map.js

http://pastebin.com/swnxNxQ8

Game.js

http://pastebin.com/EYe0RPNs

the Problem now is the update_viewport function in Map.js , i need some help to Calculate the Center position depends on Crafty.viewport maybe anyone here can help me?

Best regards BlackScorp
« Last Edit: December 14, 2011, 02:57:46 AM by BlackScorp »

Offline Doidel

  • Level 16
  • *
  • Posts: 137
  • Reputation: +2/-0
    • View Profile
    • Cohorts of Kargonar
Re: Crafty JS isometric Map drag and drop
« Reply #1 on: December 15, 2011, 03:52:03 AM »
That issue is so specific... maybe you should contact louis directly. I doubt anyone wants to spend hours to think into your problem and get used to the craftyjs environment.. (no offense)

Apart from that: Good luck!  ;D

All the best
Doidel
* Keep it simple *

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Crafty JS isometric Map drag and drop
« Reply #2 on: December 15, 2011, 04:53:55 AM »
ah sorry , forgot to update, i fixed it now. The Problem was in the place method of Crafty, it calculate automaticly the position of tile depends on viewport, but i have to calculate the position by my own .. anyways long story, replaces place() with my own place and now it works:D

Greetz BlackScorp

Offline Barrikor

  • Level 21
  • *
  • Posts: 247
  • Reputation: +3/-0
    • View Profile
Re: Crafty JS isometric Map drag and drop
« Reply #3 on: December 15, 2011, 11:26:50 PM »
I hadn't heard of CraftyJS before now, so I googled it :), looks like it can do some nice stuff
« Last Edit: December 15, 2011, 11:35:23 PM by Barrikor »
Projects: Pith Framework (at 0.5), CactusGUI (at 0.3)

Offline BlackScorp

  • Level 15
  • *
  • Posts: 123
  • Reputation: +6/-0
    • View Profile
    • Cruel Online
Re: Crafty JS isometric Map drag and drop
« Reply #4 on: December 16, 2011, 02:33:57 AM »
visit the #bbg channel on IRC there you will hear about more nice stuffs;)

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal