Hi everyone.
I just started to learn corona.
How i can use standard physics?
i try
[lua]local physics = require( “physics” )
physics.start()
mte.toggleWorldWrapX(true)
mte.toggleWorldWrapY(true)
local map = mte.loadMap(“map/Level0.tmx”)
local blockScale = 20
local locX = 44
local locY = 79
mte.setCamera({locX = locX, locY = locY, blockScale = blockScale})
local worldScaleX = mte.worldScaleX
local worldScaleY = mte.worldScaleY
–CREATE PLAYER SPRITE -----------------------------------------------------------------
local SpriteSheet = graphics.newImageSheet(“player.png”,{width = 45, height = 45, numFrames = 26})
local SeqenceData = {
{ name = “stand”, sheet = SpriteSheet, frames = {18, 19, 20, 21}, time = 1500, loopCount = 0}
}
local player = display.newSprite(SpriteSheet, SeqenceData)
local setup = {layer = 2, kind = “sprite”, locX = locX, locY = locY,
levelWidth = 32, levelHeight = 32, offsetX = 10, offsetY = -10
}
local mapObj = mte.getMapObj()
local layer = 1
physics.addBody( mte.getMapObj(), “static”, { friction=0.5, bounce=0.3 } )
physics.addBody( player, { density=3.0, friction=0.5, bounce=0.3 } )
mte.addSprite(player, setup)
mte.moveCamera(0, -40) --place camera above the sprite to improve the view
mte.setCameraFocus(player)
mte.update()
player:setSequence(“stand”)
player:play()
[/lua]
but there is no collision checking =(
is possible, or can use only physics MTE?