----------------------------------------------------------------------------------------- -- -- main.lua -- ----------------------------------------------------------------------------------------- -- Your code here --water local water = display.newImageRect("pic7-2/water.png",320, 480); water.x = display.contentCenterX water.y = display.contentCenterY --透明度參數(alpha) water.alpha = 0.8 --box local box = display.newImageRect("pic7-2/box.png",60, 60); box.x = display.contentWidth/2 box.y = 0 --ground local ground = display.newImageRect("pic7-2/ground.png",700, 60); ground.x = 0 ground.y = display.contentHeight-30 --add physics local physics = require("physics"); physics.start() physics.addBody( ground, "static" ) physics.addBody( box, "dynamic", { density=3, bounce=0.3 } )