(Snowballs Script 소스)
onLoad () {
curDepth = 1;
spriteName = curDepth;
SnowBall.velX = 0;
SnowBall.velY = 0;
SnowBall.rot = 0;
}
onEnterFrame() {
//make sure the oroginal snowball stays at the top
SnowBall.velX = 0;
SnowBall.velY = 0;
//create a new snowball
spriteName = curDepth;
SnowBall.duplicateSprite(spriteName,curDepth);
//give it some motion
(spriteName)._X = math.random() * 700;
(spriteName)._Y = -20;
(spriteName).velX = math.random() * 10 - 5;
(spriteName).velY = math.random() * 5+ 1;
(spriteName).rot = math.random() * 30 - 15;
//allow for up to 50 snowballs at once
curDepth++;
if (curDepth > 50) {
curDepth = 1;
}
}
작은 Script안에 액션소스
SnowBall
onEnterFrame() {
//Move it
_X += velX;
_Y += velY;
_rotation += rot;
//Gravity
velY += 0.2;
}
'Swish study' 카테고리의 다른 글
menu5 (0) | 2016.05.26 |
---|---|
menu4 (0) | 2016.05.26 |
swish 에서 flash 를 로드무비로 .. (0) | 2016.05.26 |
menu3 (0) | 2016.05.26 |
탄력메뉴 (0) | 2016.05.26 |