How to get correct position in TileMap?

Post your help queries and engine programming questions here

How to get correct position in TileMap?

Postby Cipher » Tue May 12, 2015 8:57 am

Hi,

I got a wired situation with Tween method. I can't put my tile entity to the correct position.

How to get the correct position in tileMap easily?

Here is my code:
Code: Select all
client.js
......
        var item = new ige.newClassInstance(type, {id: id, tileX: tileX, tileY: tileY, tileWidth: 64, tileHeight: 64})      //a IgeEntity object
//                .translateToTile(tileX, tileY)
                .mount(ige.$('tileMap01'));

        // here is the start point
   var point = new IgePoint3d(0, 0, 100);
   item.translateToPoint(point);

        item._translate.tween()
                .stepBy({z: -100}, 1000, 'inOutSine')
                .start();



Thanks for reading, any guidance or input is appreciated.
Attachments
ScreenShot.jpg
ScreenShot.jpg (142.13 KiB) Viewed 6566 times
I bought a license, I should get better service and response.
Cipher
 
Posts: 11
Joined: Fri May 08, 2015 2:59 am
Location: Taiwan, Taipei

Re: How to get correct position in TileMap?

Postby Cipher » Wed May 13, 2015 2:51 am

Maybe I should ask "how to let the new tile entity drop down to the right place?"
I try to let a new entity drop down from top to the tile map. (maybe with some sound effect).

I can't find any tween example with tile map, so, if you can provide some tutorials will be appreciate.
I bought a license, I should get better service and response.
Cipher
 
Posts: 11
Joined: Fri May 08, 2015 2:59 am
Location: Taiwan, Taipei

Re: How to get correct position in TileMap?

Postby rob » Tue Sep 29, 2015 4:47 pm

We do something similar in a game we made and used this code:

Code: Select all
buildEntity
   .translate().z(100)
   ._translate.tween(
      {z: 0},
      1000,
      {easing:'outBounce'}
   ).start();


I don't think the entity is mounted to the tile map though. Can you try creating a new scene and mounting it there instead of to the tile map?

From my memory tilemaps have a slightly different origin point which could explain why it is misaligned?
CEO & Lead Developer
Irrelon Software Limited
http://www.isogenicengine.com
User avatar
rob
Site Admin
 
Posts: 316
Joined: Tue Oct 22, 2013 5:08 pm


Return to Help & Questions

Who is online

Users browsing this forum: No registered users and 1 guest
cron