I know how to create objects like this:
local Balloon = display.newImage("balloon.png")
and I can do other stuff with it, but what I want to learn how to do is make a game where balloons fall to the ground, and when they do they pop and you loose points, and hear a sound. If you pop them BEFORE they touch the ground however, than they will give you points. How can I make it so that:
A. I hear the sound when I call upon the function that pops ballons, subtracting/adding points depending on the function/event
B. I change the balloons to have a image called “balloon_pop.png” appear for a split second and than dissapears inside the function that the balloon pops in.
C. Have a score displayed in the corner that can increase/decrease
D. (this is the last one!) make it so that when the balloon touches the object defined with this code:
local ground = display.newImage("floor.png")
ground.y = display.contentHeight - ground.stageHeight/2
physics.addBody(ground, "static", {bounce = 0.2})
it calls on a function that pops the balloon.
Other than that I watched the “Physics in 5 minutes” video and learned how to do the rest, plus I’ve watched some basic tutorials.
Thanks for helping me out,
Nighthawk0973
Edit: forgot the /code tag in one of the code boxes, the whole message was code. Fixed it! [import]uid: 58008 topic_id: 9747 reply_id: 309747[/import]
[import]uid: 12455 topic_id: 9747 reply_id: 35545[/import]