초딩김씨
Game Creator
점프점프 기능flash
댓글 4개
onClipEvent (load) { yspeed = 0;//캐릭 낙하속도 timecount=0;//중력변환 쿨타임 변수 선언 } onClipEvent (enterFrame) { timecount-=1;//중력변환 쿨타임 회복 기능 yspeed += _root.g;//캐릭 낙하속도를 중력만큼 더한다 _y += yspeed;//캐릭을 낙하속도만큼 y좌표를 움직인다 if (Key.isDown(Key.RIGHT) && _x<10000) { _x += 8;//속도는 8 대신 원하는걸로 넣으셔//우측이동(10000 대신에 움직임을 제한하 는 원하는 범위의 숫자 넣으셔) } if (Key.isDown(Key.LEFT) && _x>-10000) { _x -= 8;//속도는 8 대신 원하는걸로 넣으셔// 좌측이동(-10000 대신에 움직임을 제한 하는 원하는 범위의 숫자 넣으셔) } if (_x<-10000) { _x = -10000; }// 좌측 제한 범위 이탈 시에 되돌아옴(-10000 대신에 움직임을 제한하는 원하는 범 위의 숫자 넣으셔) if (_x>10000) { _x = 1000; }// 우측 제한 범위 이탈 시에 되돌아옴(10000 대신에 움직임을 제한하는 원하는 범위 의 숫자 넣으셔) if (_y>900&&_root.g==1) { _x = _root.리스폰._x; _y = _root.리스폰._y; yspeed=0; }// 중력이 1(아래방향)일때 리스폰 조건 if (_y<-100&&_root.g==-1) { _x = _root.리스폰._x; _y = _root.리스폰._y; yspeed=0; }// 중력이 -1(위방향)일때 리스폰 조건 if(Key.isDown(Key.SHIFT)&&timecount<0){ _root.g=_root.g*-1; timecount=30;// 중력변환(이때 쿨타임은 몇프레임으로 할건지 알아서 정하셔/필자는 60프레임중 30프레임) } if (_root.g==1&&timecount==30) { this.gotoAndStop(1); _y+=117.3;// 중력변환 시에 캐릭 중심점 바뀌는것 보완(117.3 대신에 캐릭터 높이로 수정 ㄱㄱ) } if (_root.g==-1&&timecount==30) { this.gotoAndStop(2); _y-=117.3;// 중력변환 시에 캐릭 중심점 바뀌는것 보완(117.3 대신에 캐릭터 높이로 수정 ㄱㄱ) } }
//땅 1프레임 액션 onClipEvent (enterFrame) { if (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y, 1) && _root.초딩김 씨.yspeed>=0) { _root.초딩김씨.yspeed = 0; _root.초딩김씨.yspeed -= _root.g; } while (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y-2, 1) && _root.초딩김 씨.yspeed>=-1) { _root.초딩김씨._y -= 1; } if (Key.isDown(Key.SPACE)) { if (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y+1, 1) && _root.초딩김 씨.yspeed>=-1) { _root.초딩김씨.yspeed -= 17; } } }
//땅 2프레임 액션 onClipEvent (enterFrame) { if (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y, 1) && _root.초딩김 씨.yspeed<=0) { _root.초딩김씨.yspeed = 0; _root.초딩김씨.yspeed += _root.g; } while (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y+2, 1) && _root.초딩김 씨.yspeed<=1) { _root.초딩김씨._y += 1; } if (Key.isDown(Key.SPACE)) { if (this.hitTest(_root.초딩김씨._x, _root.초딩김씨._y-1, 1) && _root.초딩김 씨.yspeed<=1) { _root.초딩김씨.yspeed += 17; } } }
저도 수능 끝나고 보도록 하겠습니다