Following player iso character using setCameraTarger()
Shri

Gio,

 

I am working on a new isometric game.

I am using setCameraTarget(player) to make the action follow the player throughout the game.

When I set the inertia to 0 (none) the game slows down considerably and it seems to have crashed the chrome browser on a couple of occasions. When I don't use setCameraTarget at all, the game runs at maybe twice or three times the speed.

I seem to have found a decent compromise with setting the inertia to 0.7.

 

My question(s) is/are:

1) have you noticed problems with setCameraTarget with inertia = zero before ?

2) is there a way I can correct the slowdown issue (i.e. have fewer layers, less scene objects, ???)

3) Is there a different or better way to "track" the player  using the other camera functions.

 

thanks for any help you can provide,

 

cheers,

Shri

1 Comment
Gio

Hi Shri

Good to know you're working on a new iso game!

Several things happen when you move the camera, whether you do it via setCameraTarget or otherwise. Basically, WADE has to redraw the whole scene when the camera moves, whereas if only the character moves on the screen, only a small part of the screen needs to be redrawn, and it's faster.

Having said that, normally moving the camera isn't a problem at all. But if you are using the minimap, it may be that it has to regenerate it when the camera moves, and that takes time. I would suggest disabling the minimap temporarily, to verify if that is the main cause of your slowdown. If that is the case, try increasing the minimap radius (and/or decrease the scale).

However, setting inertia to 0 definitely shouldn't make it crash. If it does crash, it's almost certainly a bug, and we'll fix it asap.

Post a reply
Add Attachment
Submit Reply
Login to Reply