Jump to content
  • Advertisement

Tejwinder

Member
  • Content Count

    7
  • Joined

  • Last visited

Community Reputation

110 Neutral

About Tejwinder

  • Rank
    Newbie
  1. Tejwinder

    corona sdk collision

    anyone know how to setup a collision with 2 objects
  2. my  code collision is not working   local physics = require("physics") physics.start()   display.setDefault("background", 88/255)   local myRect = display.newRect(100,100,100,100)   myRect.anchorX = 1 myRect.anchorY = 1   myRect.x = display.contentCenterX myRect.y = display.contentCenterY   physics.addBody( myRect,{ density=4.0, friction=1, bounce=0.4})   local coolRect = display.newRect(20,20,500,50)     coolRect.anchorY = 1 coolRect.anchorY = 1   coolRect.x = 250 coolRect.y = 525   physics.addBody( coolRect,{ isSensor = false} )   coolRect.bodyType = "kinematic"    local widget = require( "widget" )   local function handleButtonEvent( event )       if ( "ended" == event.phase ) then     transition.moveTo(myRect, { x=100 + 115, y=100 + 115, time=500 } )              end end   local button1 = widget.newButton {     width = 240,     height = 120,     defaultFile = "Play.png",     overFile = "Play.png",     label = "button",     onEvent = handleButtonEvent }   local function onCollision( event )     if ( event.phase == "began" ) then         print( "began: " .. event.object1.myRect .. " & " .. event.object2.coolRect )     elseif ( event.phase == "ended" ) then         print( "ended: " .. event.object1.myRect .. " & " .. event.object2.coolRect )     end end    
  3. my  code collision is not working   local physics = require("physics") physics.start()   display.setDefault("background", 88/255)   local myRect = display.newRect(100,100,100,100)   myRect.anchorX = 1 myRect.anchorY = 1   myRect.x = display.contentCenterX myRect.y = display.contentCenterY   physics.addBody( myRect,{ density=4.0, friction=1, bounce=0.4})   local coolRect = display.newRect(20,20,500,50)     coolRect.anchorY = 1 coolRect.anchorY = 1   coolRect.x = 250 coolRect.y = 525   physics.addBody( coolRect,{ isSensor = false} )   coolRect.bodyType = "kinematic"    local widget = require( "widget" )   local function handleButtonEvent( event )       if ( "ended" == event.phase ) then     transition.moveTo(myRect, { x=100 + 115, y=100 + 115, time=500 } )              end end   local button1 = widget.newButton {     width = 240,     height = 120,     defaultFile = "Play.png",     overFile = "Play.png",     label = "button",     onEvent = handleButtonEvent }   local function onCollision( event )     if ( event.phase == "began" ) then         print( "began: " .. event.object1.myRect .. " & " .. event.object2.coolRect )     elseif ( event.phase == "ended" ) then         print( "ended: " .. event.object1.myRect .. " & " .. event.object2.coolRect )     end end  
  4. Tejwinder

    how to install lua on yosemite

    i want to use lua for corona sdk
  5. Tejwinder

    how to install lua on yosemite

    how do i use the binaries after installing them
  6. how do i install lua 5.3.1 on yosemite
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!