Hi folks,
I’m quite new to Corona and I try to develop a icehockey-like game (view from top). Thus, I don’t need gravity. If I want to push the puck - wo can I simulate the friction of the ice in this mode?
I use linearDamping but the puck won’t reduce it’s speed over time. What am I doing wrong?
Thanks.
local physics = require "physics" physics.start() physics.setGravity( 0, 0 ) local backGroup = display.newGroup(); local stoneGroup = display.newGroup(); local ground = display.newImageRect(backGroup, "assets/images/background-ice.png", 723, 1400 ) ground.x = display.contentCenterX ground.y = display.contentCenterY local activeStone = display.newImageRect( stoneGroup, "assets/images/puck.png", 150, 150 ) activeStone.x = display.contentCenterX activeStone.y = display.contentHeight activeStone.linearDamping = 100 physics.addBody( activeStone, "dynamic", { radius = 150, bounce = 0 } ) local function pushPuck () activeStone:applyForce( 0, - 100, activeStone.x, activeStone.y) end activeStone:addEventListener( "tap", pushPuck )