j'ai ce code pour déplacer un clip à partir du point
un au point
b . cela fonctionne bien, aucun problème du tout avec le mouvement. Je suis le problème est d'avoir à préciser ce point a est. le code me permet de prédéfinir quel point
b sera. Je peux dire ce que le
x et
Y coords sera pour cela, mais je ne peux pas dire quel est le point
un et
Y coords Wil être
étape par étape pour le mouvement est ci-dessous:
ajouter du code au MovieClip
onClipEvent(load)
frict = .2
ratio = .1
turnSp = xSp = ySp = xScSp = yScSp = 0
turnEnd = _parent.turnEnd
xEnd = _parent.xEnd
yEnd = _parent.yEnd
xscaleEnd = _parent.xscaleEnd
yscaleEnd = _parent.yscaleEnd
onClipEvent(enterFrame)
turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
xSp = xSp*frict+(xEnd-_x)*ratio
ySp = ySp*frict+(yEnd-_y)*ratio
xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
this._x += xSp
this._y += ySp
this._rotation += turnSp
this._xscale += xScSp
this._yscale += yScSp
- onClipEvent(load)
- frict = .2
- ratio = .1
- turnSp = xSp = ySp = xScSp = yScSp = 0
- turnEnd = _parent.turnEnd
- xEnd = _parent.xEnd
- yEnd = _parent.yEnd
- xscaleEnd = _parent.xscaleEnd
- yscaleEnd = _parent.yscaleEnd
-
- onClipEvent(enterFrame)
- turnSp = turnSp*frict+(turnEnd-_rotation)*ratio
- xSp = xSp*frict+(xEnd-_x)*ratio
- ySp = ySp*frict+(yEnd-_y)*ratio
- xScSp = xScSp*frict+(xscaleEnd-_xscale)*ratio
- yScSp = yScSp*frict+(yscaleEnd-_yscale)*ratio
- this._x += xSp
- this._y += ySp
- this._rotation += turnSp
- this._xscale += xScSp
- this._yscale += yScSp
maintenant définir les paramètres pour l'interpolation dans le scénario principal
(Sur un cadre ou la touche d'action)
xEnd=475
yEnd=300
turnEnd=180
xscaleEnd = 120
yscaleEnd = 200
- xEnd=475
- yEnd=300
- turnEnd=180
- xscaleEnd = 120
- yscaleEnd = 200
voir le problème?
i don't. aimerait un peu d'aide sur ce s'il vous plaît!