And, sorry, I forgot to include the code, note that the duplication occurs when the joystick is moved to control indicator.
local storyboard = require "storyboard" local scene = storyboard.newScene() local physics = require( "physics" ) physics.start() physics.setDrawMode( "hybrid" ) local indicator--- forward declaration, para que todos los events de storyboard los reconozcan local indicatorais ----1, aqui tiene que ir todo function scene:createScene( event ) local group = self.view ---comienzo de lo mio#############################################3 display.setStatusBar( display.HiddenStatusBar ) --https://github.com/roaminggamer/SSKCorona/wiki/ssk.inputs%3AcreateJoystick PARA EL JOYSTICK --physics.setGravity( 9, 0 ) --physics.setDrawMode( "debug" ) ----------------------))))))))))))))))))))))instrumentos(((((((((((((((((((((((((((((((((((((-------------------------------------------------- ----- PIRAMIDES para la logica de movimiento--------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------- indicator=display.newCircle( 200, 170, 25 ) --indicator:setReferencePoint(display.CenterReferencePoint) physics.addBody(indicator,"dynamic",{ density = 1.0, friction = 0.3, bounce = 0.2, radius = 25 }) indicator.linearDamping = 0.5 group:insert(indicator) --indicator.gravityScale = 0.75 indicator.isVisible=false --- BASE PARA EL ROZAMIENTO DE LA PIRAMIDE --local myRectangle = display.newRect(0,256, 500, 20) local myRectangle=display.newRect(0,200,500,20) physics.addBody(myRectangle,"static") myRectangle.isVisible=false group:insert(myRectangle) ------ PARA EL EJE Y''''''''''' local indicatory=display.newImage("indicator.png") indicatory:setReferencePoint(display.CenterReferencePoint) indicatory.x=205 indicatory.y=362 physics.addBody(indicatory,{densitiy=0.01,friction=3}) indicatory.isFixedRotation = true indicatory.gravityScale = 20 indicatory.isVisible=false group:insert(indicatory) --- BASE PARA EL ROZAMIENTO DE LA PIRAMIDE local myRectangley = display.newRect(0,356, 500, 20) physics.addBody(myRectangley,"static") myRectangley.isVisible=false group:insert(myRectangley) ------------para el tacometro------------------------ --- BASE PARA EL ROZAMIENTO DE LA PIRAMIDE para el ais de abajo local myRectanglet = display.newRect(-10,570, 500, 20) physics.addBody(myRectanglet,"static") myRectanglet.isVisible=false group:insert(myRectanglet) --------------para el ais------------ indicatorais=display.newCircle( 140, 535, 25 ) physics.addBody(indicatorais,{densitiy=200,friction=1,radius=25}) indicatorais.isVisible=false group:insert(indicatorais) -- FOR THE JOYSTICK ######################################################################################################### local StickLib = require("lib\_analog\_stick") local screenW = display.contentWidth local screenH = display.contentHeight local Text = display.newText( " ", screenW\*.6, screenH-20, native.systemFont, 15 ) -- CREATE A SPACE SHIP --local Ship = display.newGroup() --Ship.x = screenW \* .5 --Ship.y = screenH \* .5 --Tmp = display.newLine(-8,0, 8,0) --Tmp.width = 2 --Tmp:setColor (255,255,255, 255) --Tmp:append (0,-24, -8,0) --Ship:insert (Tmp) -- CREATE ANALOG STICK MyStick = StickLib.NewStick( { x = screenW\*.87, y = screenH\*.84, thumbSize = 16, borderSize = 92, snapBackSpeed = .75, R = 255, G = 255, B = 255 } ) --------------- -- MAIN LOOP local function main( event ) -- MOVE THE SHIP -- MyStick:move(Ship, 7.0, true) -- SHOW STICK INFO --Text.text = "ANGLE = "..MyStick:getAngle().." DISTANCE = "..math.ceil(MyStick:getDistance()).." PERCENT = "..math.ceil(MyStick:getPercent()\*100).."%" MyStick:movex( indicator, 3,false)--para mover la piramide MyStick:movey( indicatory, 3,false)-- para mover la otra piramide end Runtime:addEventListener( "enterFrame", main ) end ----2 function scene:enterScene( event ) local group = self.view --indicator.x=200 todo esto no es necesario ya que la x y la y la dices en create circle --indicator.y=170 --indicatorais.x=140 --inicialmente 0 idle --indicatorais.y=535 end ----3 function scene:exitScene( event ) end scene:addEventListener( "createScene" ) ----4 function scene:destroyScene( event ) print( "((destroying scene 1's view))" ) end -------------------------------------------------------------------------------- -- END OF YOUR IMPLEMENTATION --------------------------------------------------------------------------------- -- "createScene" event is dispatched if scene's view does not exist scene:addEventListener( "createScene", scene ) -- "enterScene" event is dispatched whenever scene transition has finished scene:addEventListener( "enterScene", scene ) -- "exitScene" event is dispatched before next scene's transition begins scene:addEventListener( "exitScene", scene ) -- "destroyScene" event is dispatched before view is unloaded, which can be -- automatically unloaded in low memory situations, or explicitly via a call to -- storyboard.purgeScene() or storyboard.removeScene(). scene:addEventListener( "destroyScene", scene ) --------------------------------------------------------------------------------- return scene