Please list all camera related issues here

Similar to what borgb suggested I’d go with something like this:

  
local onUpdate = function(event)  
  
 if player and player.shouldBeTracked then   
 map:setPosition(player.x, player.y)   
 end  
  
 map:update(event)  
  
end  
  
Runtime:addEventListener("enterFrame",onUpdate)  
  

Then have player.shouldBeTracked set to true when you first create your player object and as soon as a collision is triggered set it to false allowing the slideToPosition transition to work. Once you have done whatever you wish to do simply set it back to true again. Maybe after sliding the camera back to the player to make it look smooth. [import]uid: 5833 topic_id: 5038 reply_id: 22939[/import]

Awesome Graham, it looks like I can actually stop the player tracking and slide the map using what you suggested. Now I’m running into the problem of having it wait.

For example, if I put a move over followed by a move back, the camera simply doesn’t move because it processes it so quickly. So I figured I could use a timer.performWithDelay…

Ideally when it’s all said and done I want to stop tracking, move the camera over, wait, move it back, then restore tracking of the player.

I’m grasping at straws now so I’ve put something together where I defined a moveover and a moveback and threw them in a timer.performWithDelay like this inside the collision event…

player.shouldBeTracked = false  
moveover = map:slideToPosition(400,100,1000)  
moveback = map:slideToPosition(player.x, player.y, 1000)  
timer.performWithDelay ( 5000, moveover, 1 )  
timer.performWithDelay ( 5000, moveback, 1 )  
player.shouldBeTracked = true  

You can probably already guess that this doesn’t work. :slight_smile: I’m guessing timer.performWithDelay is not the right thing to use here…?

Thanks as always to anyone who can help out. [import]uid: 37480 topic_id: 5038 reply_id: 23139[/import]

Hi, i don’t know if you’ve solved the problem, but try:

ball:addEventListener(“touch”, ballShot)

local onUpdate = function(event)
map:setTrackingPoint(ball)
map:update(event)
end
Runtime:addEventListener(“enterFrame”, onUpdate)

this should work [import]uid: 30837 topic_id: 5038 reply_id: 23191[/import]

What you would want to do is use completion listeners for the transitions, for some reason I have left them out of the map move functions so when I get back to my pc (tomorrow) I will add them in for 2.8 which will also be released either tomorrow or friday. [import]uid: 5833 topic_id: 5038 reply_id: 23207[/import]

That sounds great Graham. I may need further help with the correct syntax, but I’m looking forward to the update! [import]uid: 37480 topic_id: 5038 reply_id: 23258[/import]

No problems, once the update is out feel free to ask any questions you like. [import]uid: 5833 topic_id: 5038 reply_id: 23307[/import]

Hi

Im working on my plaform game and started testing it out on my iphone (3gs), and I notice the fps drop when using the map:update(event) within a enterframe listener. You mention a fix in this thread but cant find that code in the file anymore, has this been removed? and is there a fix for the fps drop?

I use it too track my player with a map:setFocus(player), in case there is a better way to do this :slight_smile: [import]uid: 17969 topic_id: 5038 reply_id: 25781[/import]

Hey, the fix for that bug was put in however the actual FPS drop is also due to the lack of real culling. Currently Lime has a fairly primitive method however we are waiting for a more optimised and native solution provided by Ansca. [import]uid: 5833 topic_id: 5038 reply_id: 25809[/import]

So the reason the game drops too about 12fps every 2-3second is because it updates the whole map? Lets hope they make a fix for this then before Im ready too launch, hehe :slight_smile: Else my levels need to be downsized or fixed in some way. I’ll have too start looking into solutions for that. Thanks for quick reply! [import]uid: 17969 topic_id: 5038 reply_id: 25875[/import]

I’m really hoping the issues get solved ASAP! I’m still waiting to hear more from Ansca but I know they are working on speed improvements. [import]uid: 5833 topic_id: 5038 reply_id: 25903[/import]

I made a platform game map,the width about 3000px,
it contents 20 platforms.
then I made it scroll by map:slideToPosition().

but the performace scare me !
the fps around 10-25.

how can I let it scroll smoothly ?

thanks. [import]uid: 21680 topic_id: 5038 reply_id: 28362[/import]

Hi Jason,

The performance for large maps is currently pretty poor due to there being no culling going on in Corona. We are working on improvements ourselves however I am hoping that Ansca get some native optimisations added into Corona sooner rather than later.

Graham [import]uid: 5833 topic_id: 5038 reply_id: 28778[/import]