Help needed for this newby, Whack A Bieber game

Hello all, hope this message find everyone ok, i’m new to this community and I would like to see if i can get some help.

I just released a game for Android, called Whack A Bieber, and I would like to make an ios version of this game, i did some research and could not find any other platform that makes it so simple and fun to write applications with other than Corona SDK, i just love the fact that it is easy to install without having to install all this other files etc. It just blows my mind how easy it is to develop games with this amazing platform.

However, i do need some help since i’m fairly new, my programming background has only been in Visual Studio, and a little bit of Java, with that said, I would like some help and advice on how to go about porting my android application over to ios, I Used Basic4Android and libGDX for that application.

here’s the code i’ve written so far, this displays the background with the 9 holes and 3 images of justin bieber, however i’m still a little confused on how to detect when one of the biebers is tapped, i would like to make the same effect as in the android game, when the actor is hit it hides in its corresponding hole, but i can’t create the same effect with corona sdk.

I would also like to create the random effect of the images popping out of their holes at a determined speed and time.

Is this possible? can someone point me in the right direction?

I really appreciate your help in advance.

Regards,

Walter

display.setStatusBar( display.HiddenStatusBar ) local halfW = display.viewableContentWidth / 2 local halfH = display.viewableContentHeight / 2 local movieclip = require('movieclip') local b1 local b2 local b3 local b4 local b5 local b6 local b7 local b8 local b9 local groupb = display.newGroup() local groupm = display.newGroup() local groupt = display.newGroup() local groupt2 = display.newGroup() local groupt3 = display.newGroup() local groupt4 = display.newGroup() local groupt5 = display.newGroup() local biebers local timerSource local currentWorms = 0 --worms already shown local wormsHit = 0 local totalWorms = 3 --total worms to hit local bieberHit = {} local lastWorm = {} local stage = display.getCurrentStage() local backgroundPortrait = display.newImageRect( "bk\_5.png", 570, 60) backgroundPortrait.x = 240 backgroundPortrait.y = 300 b1 = display.newImageRect( "b9.png", 100, 135 ) b1.x = 240 b1.y = 260 b1:toBack() b2 = display.newImageRect( "b9.png", 100, 135 ) b2.x = 60 b2.y = 210 b2:toBack() b3 = display.newImageRect( "b9.png", 100, 135 ) b3.x = 410 b3.y = 210 b3:toBack() -- b4 = display.newImageRect( "b9.png", 100, 135 ) -- b4.x = 395 -- b4.y = 160 -- b4:toBack() local bk4 = display.newImageRect( "bk\_4.png", 570, 60) bk4.x = 240 bk4.y = 258 local bk3 = display.newImageRect( "bk\_3.png", 570, 75) bk3.x = 240 bk3.y = 214 local bk2 = display.newImageRect( "bk\_2.png", 570, 180) bk2.x = 240 bk2.y = 105 groupb:insert( 1, backgroundPortrait ) groupm:insert( 1, b1 ) groupt:insert( 1, bk4) groupt2:insert( 1, b2 ) groupt4:insert( 1, b3 ) groupt3:insert( 1, bk3 ) groupt5:insert( 1, bk2 ) stage:insert( 1, groupb[1]) stage:insert( 1, groupm[1]) stage:insert( 1, groupt[1]) stage:insert( 1, groupt2[1]) stage:insert( 1, groupt4[1]) stage:insert( 1, groupt3[1]) stage:insert( 1, groupt5[1]) biebers = display.newGroup( stage[6], stage[4], stage[3] ) biebers[1].name = 1 biebers[2].name = 2 biebers[3].name = 3 for i = 1, biebers.numChildren do print( "num of children ", i) biebers[i]:addEventListener('tap', bieberHit) end function bieberHit:tap(e) local actor print( e.target.name ) if e.target.name == 1 then transition.to( biebers[1], { time=400, y=150, transition=easing.inExpo } ) elseif e.target.name == 2 then transition.to( biebers[2], { timee=400, y=150, transition=easing.inExpo } ) elseif e.target.name == 3 then transition.to( biebers[3], { time=400, y=150, transition=easing.inExpo } ) -- elseif e.target.name == 4 then -- transition.to( worms[4], { time=400, y=350, transition=easing.inExpo } ) end startTimer() end function startTimer() timerSource = timer.performWithDelay(1400, showBiebers, 0) --print("lastworm Position ", lastWorm.y) end function showBiebers(e) if(currentWorms == totalWorms) then else local randomHole = math.floor(math.random() \* 3) + 1 lastWorm = biebers[randomHole] print( "lastWorm ", lastWorm) lastWorm.isvisible = true --transition.to( lastworm, {time=400, y=-150, transition=easing.inExpo}) Runtime:addEventListener('enterFrame', popOut) currentWorms = currentWorms + 1 end end function popOut(e) --transition.to( lastWorm, {time=400, y=150, transition=easing.InExpo}) lastWorm.y = lastWorm.y - 5 print(" y position ", lastWorm.y) if lastWorm.y \>= -100 then Runtime:removeEventListener('enterFrame', popOut) end end

www.learningcorona.com
I think there’s a tutorial on there

Sorry i could not find anything there, i’m still in need of help for this, as i said i’m fairly new to Corona Sdk, and i have a lot to learn, currently i managed to set my background which is made out of 4 different layers, and i’ve added three justin beiber images, what i need is a way to animate the bieber images so that they can go in the holes when hit and pop back out at a determined time, of course this would have to be random.

kindle_image4.jpg

Again thanks in advance for the help, and hope to get this solved soon.

Regards,    

Walter 

http://code.tutsplus.com/tutorials/corona-sdk-create-a-whack-a-mole-game-application-setup–mobile-8422

Thanks jstrahan, i’m actually already following that tutorial, that’s how i got started but in that tutorial they are actually changing the y scale on the worms, what i want is to move the image into the hole, but more than that i need to learn how to create a function that will randomly make the images pop out of their holes.

Thanks again!

www.learningcorona.com
I think there’s a tutorial on there

Sorry i could not find anything there, i’m still in need of help for this, as i said i’m fairly new to Corona Sdk, and i have a lot to learn, currently i managed to set my background which is made out of 4 different layers, and i’ve added three justin beiber images, what i need is a way to animate the bieber images so that they can go in the holes when hit and pop back out at a determined time, of course this would have to be random.

kindle_image4.jpg

Again thanks in advance for the help, and hope to get this solved soon.

Regards,    

Walter 

http://code.tutsplus.com/tutorials/corona-sdk-create-a-whack-a-mole-game-application-setup–mobile-8422

Thanks jstrahan, i’m actually already following that tutorial, that’s how i got started but in that tutorial they are actually changing the y scale on the worms, what i want is to move the image into the hole, but more than that i need to learn how to create a function that will randomly make the images pop out of their holes.

Thanks again!