Bonjour,
je fais un swf ou on pourra déplacé le hero ...
Helas quand je fait :
- Code:
-
_root.posX=_root/hero._x;
_root.posY=_root/hero._y;
touchegauche= keyIsDown(37);
if(touchegauche)// si la touche est appuyée
{
if (_root.posX == 0)
{
}
else
{
_root.posX=_root.posX-5;
}
}
[...]
_root/hero._x=_root.posX;
_root/hero._y=_root.posY;
le perso s'arrette d'aller a gauche beaucoup plus loin des limites de l'animation ex :
| |
| |
| O |
^1 ^2 ^3
1 limite fenetre windows
2 ENdroit ou s'arrette l'objet qu'on déplace
limite de l'animation (autrement dit 0)
meme probleme a droite ou lorsque cette fois si on test si il est a 400 (mon projet fait 400X300), le perso s'arrette : cette fois si avant !
Que faire ?
merci