Stop a scrolling game

Hi!

I’m trying to stop a scrolling game, using JungleScene as base. I got a sprite in the middle(mycharacter) and I’m scrolling the background and street he’s walking on, but I can’t figure out how to stop the scrolling when I’m pressing a button. Basically what I want to do is stop the scrolling and play another set of frames from the spritesheet. Then press another button and everything starts moving again.

Anyone got any hints?

Thanks alot [import]uid: 21652 topic_id: 13400 reply_id: 313400[/import]

use a bool switch like

local animateBG = true  

now, in your enterFrame animation method, do

function animateBackground ()   
 if animateBG == true then  
  
 -- all the animation stuff  
  
 else  
  
 -- play another set of frames  
  
 end  
end  

on a button or any other event switch between false/true

hope that helps,
-finefin [import]uid: 70635 topic_id: 13400 reply_id: 49227[/import]

I got it to work!

I made two buttons, one to set the bool to true and the other to false.
Now I just got to figure out how to randomly spawn stuff…

Thanks alot! [import]uid: 21652 topic_id: 13400 reply_id: 49238[/import]