는 여기이 자습서를 따라 한 - 나는 간단한 젤다 스타일의 RPG 게임을 만들려고 노력하고 있지만 튜토리얼에 동적 배경을 사용 http://www.stormation.info/rpg-game-creation-tutorial/플래시 (AS2)에서 문자 충돌이있는 PNG 이미지 .... 방법?
. 캐릭터가 걸을 수있는 투명한 영역이있는 PNG 이미지를 사용하고 싶습니다. 이처럼
는 : http://www.imagebam.com/image/de39a1325517813
http://www.imagebam.com/image/5e22e6325517815
http://www.imagebam.com/image/753d56325517819
나는 문자를 차단하기 위해 투명한 영역에서 떨어져 모든 것을 할 수 있습니다. 이것이 가능한가?
이 튜토리얼에는 충돌 감지 기능이 있지만 png를 무비 클립으로 만들면 코드와 일치하는 인스턴스 '벽'을 사용하여 장면을 테스트 할 때 내 캐릭터가 사라집니다. 여기
내 현재 AS2 코드 :onClipEvent(load){
radius = 6
for (stop in this) {
this[stop].stop()
}
}
onClipEvent(enterFrame){
if(Key.isDown(Key.UP)){
this._y -= speed
facing = "up"
}
if(Key.isDown(Key.DOWN)){
this._y += speed
facing = "down"
}
if(Key.isDown(Key.RIGHT)){
this._x += speed
facing = "right"
}
if(Key.isDown(Key.LEFT)){
this._x -= speed
facing = "left"
}
if(Key.isDown(Key.SHIFT)){
speed = 5
state = "run"
}else{
speed = 3
state = "walk"
}
if(!Key.isDown(Key.LEFT) && !Key.isDown(Key.RIGHT) && !Key.isDown(Key.UP) && !Key.isDown(Key.DOWN)){
this[facing].gotoAndStop(1)
}else{
this[facing].play()
}
while(_root.walls.hitTest(_x, _y+radius/2, true)){
_y--;
}
while(_root.walls.hitTest(_x, _y-radius, true)){
_y++;
}
while(_root.walls.hitTest(_x-radius, _y, true)){
_x++;
}
while(_root.walls.hitTest(_x+radius, _y, true)){
_x--;
}
gotoAndStop(state+facing)
depthControl()
}