ball.js

cc.Class({
extends: cc.Component, properties: {
x_vel:{
default:0
},
y_vel:{
default:0
},
grivatity:{
default:null
}, }, onLoad: function () { this.grivatity=-1;
}, init:function ( x_vel,y_vel) {
this.x_vel=x_vel
this.y_vel=y_vel
}, update: function (dt) { var now=this.node.position
now.y+=this.y_vel
now.x+=this.x_vel
this.y_vel+=this.grivatity
this.node.position=now //销毁
if(now.y<-320)
this.node.destroy();
},
});

Muller.js

cc.Class({
extends: cc.Component, properties: {
x_vel:{
default:0
},
y_vel:{
default:0
},
grivatity:{
default:null
}, }, onLoad: function () { this.grivatity=-1;
}, init:function ( x_vel,y_vel) {
this.x_vel=x_vel
this.y_vel=y_vel
}, update: function (dt) { var now=this.node.position
now.y+=this.y_vel
now.x+=this.x_vel
this.y_vel+=this.grivatity
this.node.position=now //销毁
if(now.y<-320)
this.node.destroy();
},
});

ccc 模拟重力 正太分布的更多相关文章

  1. ccc 模拟重力

    x=x+v v=v+gr cc.Class({ extends: cc.Component, properties: { velocity:{ default:null }, grivatity:{ ...

  2. R语言绘制正太分布图,并进行正太分布检验

    正态分布 判断一样本所代表的背景总体与理论正态分布是否没有显著差异的检验.   方法一概率密度曲线比较法 看样本与正太分布概率密度曲线的拟合程度,R代码如下: #画样本概率密度图s-rnorm(100 ...

  3. canvas模拟重力效果

    总结 速度和加速度是动画的基础元素,其中两者都是向量,包括了一个重要因素:方向. 要学会应用 分解 和 合成 ,将速度或加速度分解到x.y轴上,然后将每条轴上的加速度或速度相加,然后再分别与物体的位置 ...

  4. Android sample 之模拟重力感应,加速度

    class SimulationView extends View implements SensorEventListener { // diameter of the balls in meter ...

  5. 科学计算 NumPy 与C语言对比 N-dimensional array ndarray 元素元素操作 计算正太分布分位数

    w http://www.numpy.org/ NumPy is the fundamental package for scientific computing with Python. It co ...

  6. 数学建模python matlab 编程(喷泉模拟)

    在无风情况下的喷泉模拟 我的python代码 import numpy as np import random import matplotlib matplotlib.rcParams['font. ...

  7. Cocos2d-x 3.1.1 Lua实例-AccelerometerTest(重力加速计)

    Cocos2d-x 3.1.1 Lua实例-AccelerometerTest(重力加速计) 本篇博客介绍Cocos2d-x的第一个实例--重力加速计測试.效果图(注:这里无法模拟重力感应): --[ ...

  8. T分布

    # T分布 # 1.T分布是统计分布的一种,同卡方分布(X2分布),F分布并称为三大分布 2.T分布又叫student-t分布,常用于根据小样本来估计呈正太分布且方差值未知的样本的均值(如果总体的方差 ...

  9. R代码展示各种统计学分布 | 生物信息学举例

    二项分布 | Binomial distribution 泊松分布 | Poisson Distribution 正态分布 | Normal Distribution | Gaussian distr ...

随机推荐

  1. CodeForces 282C(位运算)

    C. XOR and OR time limit per test 2 seconds memory limit per test 256 megabytes input standard input ...

  2. 瞧一瞧迷一般的SQLDA

    With static SQL, host variables used in embedded SQL statements are known at application compile tim ...

  3. NYOJ题目817英文藏头诗

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtEAAAKXCAIAAADLqoEhAAAgAElEQVR4nO3dO1LrzNbG8W8S5AyE2D

  4. NYOJ之猴子吃桃问题

    aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAskAAAIMCAIAAACIcqa9AAAgAElEQVR4nO3dO3Li3BaG4TMJcgbi1A

  5. NYOJ之括号配对问题

    括号配对问题 时间限制:3000 ms  |  内存限制:65535 KB 难度:3 描述     现在,有一行括号序列,请你检查这行括号是否配对. 输入     第一行输入一个数N(0<N&l ...

  6. Delphi线程的终止

    当线程对象的Execute()执行完毕,我们就认为此线程终止了.这时候,它会调用Delphi的一个标准例程EndThread(),这个例程再调用API函数ExitThread().由ExitThrea ...

  7. 信号量进程同步,王明学learn

    信号量进程同步 一组并发进程进行互相合作.互相等待,使得各进程按一定的顺序执行的过程称为进程间的同步. 信号量在进程同步时初始值为:0 信号量在进程互斥时初始值为:大于0的 本章节主要使用信号量,使的 ...

  8. MicroService/web Service/webAPI/RPC

    [TOC] 微服务 服务拆分,利用轻量化机制(通常为HTTP源API)实现通信,复杂度可控,独立部署,技术选型灵活,容错,扩展. 康威定律的实际体现 微服务架构模式深刻影响了应用和数据库之间的关系,不 ...

  9. Android屏幕适配全攻略(最权威的官方适配指导) (转)

    招聘信息: Cocos2d-X 前端主程 [新浪微博]手机客户端iOS研发工程师 20k-40k iOS 开发工程师 iOS高级开发工程师(中国排名第一的企业级移动互联网云计算公司 和创科技 红圈营销 ...

  10. Codeforces Round#250 D. The Child and Zoo(并差集)

    题目链接:http://codeforces.com/problemset/problem/437/D 思路:并差集应用,先对所有的边从大到小排序,然后枚举边的时候,如果某条边的两个顶点不在同一个集合 ...