I am trying to get different things to happen on different numbered touches ( if that makes any sense ) so if I touch the button once it will remove an image, and if I touch it again ( second time ) it would call a function. I've been trying different ways but after the image is removed I keep getting an error, that the image is nil, cause it is already removed. Thanks
Label: corona android iphone ipad building error inmobi problem display screen View image tableView failed object physics touch button game lua config event listener |
Different Events On Multiple Button Touches
Posting some code would help. It's hard from your description to figure out what you are trying to accomplish.
-David
I am creating a dinosaur game for kids. In one section of the app, they can dig up dinosaur bones. I have 6 pictures all with different alpha masks to expose more bones as you dig. I have a shovel button with a removeSelf event for the images every time the button is tapped until it gets to the last image then it wont remove anymore images ( xxxfanta help me with that one )
1 2 3 4 5 6 7 8 | -- local function removeImage( event ) if ( digGroup.numChildren > 1 ) then digGroup[ digGroup.numChildren ]:removeSelf() end end shovel:addEventListener( "tap", removeImage ) |
I would consider not deleting the object, but rather have the object displayed as a sprite that is indexed with each scoop of a shovel. You could had the image represented as 2.5D image.
Might be easier and address an issue if the player only digs part way and moves on to another location.
-David
send message and call to a person
Forum: Report Spam + PM
[INSTALL_PARSE_FAILED_NO_CERTIFICATES]
[SOLVED] Director ERROR: Failed to execute new( params ) function on 'screen1'
Too many (200) local variables
Corona SVG Level Builder released. Drag and drop physics level editor with Inkscape and SVG.
Small bug in Collectible Items example
Pivot Joints and apparent elasticity
Can't make removeSelf() delayed
OpenFeint library errors when not using OpenFeint
Pricing
Autism Research, please help
Workflow suggestions
First Module in Lua, review please
Remote Application Testing on multiple actual devices without buying them...
SOLVED - Randomly print a statement.
Store an audio file
Multibuild Compiler