---
title: "update方法和角度转化"
author: "rayln"
date: "2013-12-04T20:08:08Z"
tags: []
categories: ["移动开发"]
slug: "update"
draft: false
lastmod: "2013-12-04T20:09:48Z"
id: 1985284
url: "https://rayln.iteye.com/blog/1985284"
---

**首先在头文件中加入**

```c++

virtual void update(float delta);

```


**在ccp文件中**

```c++

this->scheduleUpdate();

```


这样每一帧都会调用这个方法

**取消调用update方法**

```c++

this->unscheduleUpdate();

```


**弧度与xy转化**

```c++

float x = cos(n/180*3.14)*r; //n为弧度，r为半径
float y = sin(n/180*3.14)*r; //n为弧度，r为半径

```