ccc 模拟重力 正太分布
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 模拟重力 正太分布的更多相关文章
- ccc 模拟重力
x=x+v v=v+gr cc.Class({ extends: cc.Component, properties: { velocity:{ default:null }, grivatity:{ ...
- R语言绘制正太分布图,并进行正太分布检验
正态分布 判断一样本所代表的背景总体与理论正态分布是否没有显著差异的检验. 方法一概率密度曲线比较法 看样本与正太分布概率密度曲线的拟合程度,R代码如下: #画样本概率密度图s-rnorm(100 ...
- canvas模拟重力效果
总结 速度和加速度是动画的基础元素,其中两者都是向量,包括了一个重要因素:方向. 要学会应用 分解 和 合成 ,将速度或加速度分解到x.y轴上,然后将每条轴上的加速度或速度相加,然后再分别与物体的位置 ...
- Android sample 之模拟重力感应,加速度
class SimulationView extends View implements SensorEventListener { // diameter of the balls in meter ...
- 科学计算 NumPy 与C语言对比 N-dimensional array ndarray 元素元素操作 计算正太分布分位数
w http://www.numpy.org/ NumPy is the fundamental package for scientific computing with Python. It co ...
- 数学建模python matlab 编程(喷泉模拟)
在无风情况下的喷泉模拟 我的python代码 import numpy as np import random import matplotlib matplotlib.rcParams['font. ...
- Cocos2d-x 3.1.1 Lua实例-AccelerometerTest(重力加速计)
Cocos2d-x 3.1.1 Lua实例-AccelerometerTest(重力加速计) 本篇博客介绍Cocos2d-x的第一个实例--重力加速计測试.效果图(注:这里无法模拟重力感应): --[ ...
- T分布
# T分布 # 1.T分布是统计分布的一种,同卡方分布(X2分布),F分布并称为三大分布 2.T分布又叫student-t分布,常用于根据小样本来估计呈正太分布且方差值未知的样本的均值(如果总体的方差 ...
- R代码展示各种统计学分布 | 生物信息学举例
二项分布 | Binomial distribution 泊松分布 | Poisson Distribution 正态分布 | Normal Distribution | Gaussian distr ...
随机推荐
- core
http://blog.csdn.net/xiaoxiaoniaoer1/article/details/7740820 1.core文件的生成开关和大小限制--------------------- ...
- Linux安装mysql最新版本纪要
http://blog.csdn.net/frt007/article/details/50184143 http://blog.csdn.net/wb96a1007/article/details/ ...
- C#的正则表达式
using System; using System.Collections; using System.Collections.Generic; using System.IO; using Sys ...
- Oracle数据库锁表及解锁进程
下午代码迁移,更新数据库记录时for update语句无法执行,数据库被锁,KILL掉几个进程搞定. Oracle数据库操作中,我们有时会用到锁表查询以及解锁和kill进程等操作,那么这些操作是怎么实 ...
- Platform SDK、Windows SDK简介
Platform SDK及Windows SDK是由微软公司出品的一个软件开发包,向在微软的Windows操作系统和.NET框架上开发软件和网站的程序员提供头文件.库文件.示例代码.开发文档和开发工具 ...
- Vmware 中安装Unix
准备 1. ubuntu 14.10 下载地址: 官网下载链接 http://www.ubuntu.com/download/desktop 官方版本库 http://releases.ubuntu. ...
- 7-14 EXISTS子查询
EXISTS: 只注重于子查询是否有返回行,如果查有返回行返回结果为值,否则为假 并不使用子查询的结果,仅用于测试子查询是否有返回结果. 语法: IF EXISTS (子查询) BEGIN 语句块 E ...
- phpMailer邮件发送
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...
- Windows+Git+TortoiseGit+COPSSH 安装图文教程
转自:http://blog.csdn.net/aaron_luchen/article/details/10498181 准备工作: 1. Git-1.8.1.2-preview20130201.e ...
- C# RFID windows 服务 串口方式
话说RFID以前很火所以整理一下一年前自己处理的RFID程序,放源码. 一开始觉得他是个很神奇的东西. 包含串口通讯和网络通讯. 由于网络通讯设备太贵,所以国内的设备基本上都是在外置一个比较便宜的模块 ...