A few questions and need some help

I used to script in lua but none of it was really hard coded, i script in other languages so are any like lua? if so what languages are like lua. Also since i practically just started in lua what is the best way (your recommendations)to learn it. Currently i am working on my first lua game and basically what i got so far is the background in the sky, i made a balloon in Gimp, and i have a balloon spawner script going. gravity is negative so the balloons float upward and you are suppose to tap the balloons and they will pop. i havent gotten to the pop part because i dont really know how i should do it but im trying to atleast get it to play this balloon popping noice.

Here is my code so far

system.activate("multitouch")  
  
 local physics = require("physics")  
 physics.start()  
 physics.setGravity(0, -2)  
  
 local background = display.newImage("bkg\_background001.png")  
  
 local isPaused = false  
  
 local function spawnBalloon( event )  
 balloon = display.newImage("balloon001.png")  
 balloon.x = math.random(500)  
 balloon.y = 1100  
 balloon.rotation = 0  
 --balloon.name("balloon")  
 physics.addBody( balloon, {friction = 0.5})  
 balloon.collision = onCollide  
  
 balloon:addEventListener("collision", balloon)  
 if(balloon:addEventListener( "touch", balloon)) then  
 media.playsound("popSound")  
 end  
 end  
  
 local function PausePlay()  
 pause = display.newImage("pause.png")  
 pause.x = ScreenWidth/2  
 pause.y = ScreenHeight/2  
 play = display.newImage("play.png")  
  
 if(pause:addEventListener( "touch", pause)) then  
 system.vibrate()  
  
 end  
 end  
  
 display.setStatusBar(display.HiddenStatusBar)  
  
 timer.performWithDelay(500, spawnBalloon, 500)  

Im also trying to get it to pause but i dont really know how to do the applicationsuspend and applicationresume i tried looking stuff up but im a little tired so i really didnt find anything [import]uid: 81383 topic_id: 13463 reply_id: 313463[/import]

to do the popping animation you can use movieclips or spritesheets. both will show a sequence of images to get an animated popping effect.

to implement pause in above code you have to do 3 things

  1. pause physics (use physics.pause())
  2. stop the timer which calls spawnBalloon
  3. remove the event listener attached to the current baloon
    Happy Coding :slight_smile:
    Renjith
    www.technowand.com
    [import]uid: 71210 topic_id: 13463 reply_id: 49428[/import]