class SimulationView extends View implements SensorEventListener { // diameter of the balls in meters private static final float sBallDiameter = 0.004f; private static final float sBallDiameter2 = sBallDiameter * sBallDiameter; // friction of the vir…
Cocos2d-x 3.1.1 Lua实例-AccelerometerTest(重力加速计) 本篇博客介绍Cocos2d-x的第一个实例--重力加速计測试.效果图(注:这里无法模拟重力感应): --[[ AccelerometerTest.lua 重力加速器样例 ]] --返回一个层 local function AccelerometerMainLayer() -- 返回标题 local function title() return "AccelerometerTest" end…