'game'에 해당되는 글 2건

  1. 2008.06.21 Last Exile - OpenGL 슈팅 게임
  2. 2007.02.04 Isometric view (2)
프로젝트2008.06.21 17:38

사용자 삽입 이미지

제작기간 : (2005. 6 2005. 6 : 2)

게임 프로그래밍 수업의 프로젝트였던  Last Exile입니다.
(동명의 애니메이션을 재밌게 보았었습니다 ^^; )


 
개발 목표는 상당히 높았습니다. 특수 미사일등도 개발하여 (ex. 중력탄
터지면 블랙홀 처럼 근처의 모든 기체를 빨아들이며 일정 시간이 지난 후 대폭발을 한다) 화려하게 대미를 장식할 예정이였으나, 짧았던 개발기간으로 인하여 많은 것을 보여주지는 못했습니다만, 교수님께는 높은 점수를 받았었습니다. ^^

아쉽게도 게임의 시작과 끝이 없고 데미지 등도 없어서..
게임성은 좀 떨어지죠.. ^^;;

p.s.
기억이 잘 안 나지만.. 릴리즈하지 않고 디버그로 컴파일 되어있을 수도 있어서-_-;;
dll파일이 필요할 수도 있습니다.

다운로드 :



'프로젝트' 카테고리의 다른 글

ActiveX 웹에디터  (0) 2008.06.21
마우스 제스쳐를 이용한 애니메이션 제어  (0) 2008.06.21
Big Hit! - 비디오 대여 시스템  (0) 2008.06.21
Last Exile - OpenGL 슈팅 게임  (0) 2008.06.21
자리 배치 프로그램(2005년 9월)  (2) 2007.01.21
이 분류의 목적  (0) 2007.01.20
Posted by 시난
TAG game, MFC

댓글을 달아 주세요

프로그래밍2007.02.04 00:31

Isometric view -

출처 : http://www.tonypa.pri.ee/tbw/tut16.html

Isometric view is great to add depth into your game. Many famous games use this vie, because its simple to do, but looks good. And best thing about isometric view is how easy it is to create based same old tile based approach. Like this:

Theory

First you should know, that actual isometric view (from the mathematics) is little more complicated and never used in games. Now that you know it, forget it. From here on, we only talk about simple isometrics. Maybe best way to imagine isometric, is to look, what happens to the normal square, when its transformed into isometric view:

First we rotate the square by 45 degrees and then we make its height half the width. That was simple. Now lets create our tiles and hero:

Its important to place graphics to the registration point (little cross, where Flash starts to count coordinates from) like shown in the picture. The wall tile you can draw as high as you want. For the hero, I have left the tile in the picture so you hopefully understand its position better, dont place that rectangle in the final graphics of hero. It would only look strange, if hero walks around, rectangle around him.

Changes to the code

First thing to change, is size of tiles and size of hero. But wait, what size? So far it was clear, width and height of movie clip, but in isometric view the height of movie clip can be almost anything.

So, value of tileW variable is half the width of actual tile graphics. For the hero, its width and height properties are equal and half of its graphics actual width. Write it down:

game={tileW:30};
char={xtile:2, ytile:1, speed:4, width:16, height:16};

Biggest change in the code will be actual placement of movie clips on screen. In normal view, we used clip._x=x and clip._y=y, to make same x/y appear in isometric view, we will use:

clip._x=x-y;
clip._y=(x+y)/2;

In the buildMap function change placement of tiles:

clip[name]._x = (j-i)*game.tileW;
clip[name]._y = (j+i)*game.tileW/2;

Tiles depth is calculated same way as before, but we wont use x/y, we will use tiles new coordinates in isometric view:

game[name].depth=(j+i)*game.tileW/2*300+(j-i)*game.tileW+1;

And same thing for the hero:

var ob=char;
ob.x = ob.xtile*game.tileW;
ob.y = ob.ytile*game.tileW;
ob.xiso = ob.x-ob.y;
ob.yiso = (ob.x+ob.y)/2;
ob.depthshift=(game.tileW-ob.height)/2;
ob.depth=(ob.yiso-ob.depthshift)*300+ob.xiso+1;
game.clip.attachMovie("char", "char", ob.depth);
ob.clip=game.clip.char;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;

As you can see, new properties xiso and yiso will hold the coordinates of char in the isometri view, but we still have properties x/y. Variable depthshift is needed since our char is not drawn on the center of the tile (look the picture with char), it is shifted up.

All the collision and movements are calculated in normal way, but in the end position of movie clip is converted into isometric view. In the end of moveChar function change the char placement same way:

ob.xiso = ob.x-ob.y;
ob.yiso = (ob.x+ob.y)/2;
ob.clip._x = ob.xiso;
ob.clip._y = ob.yiso;
ob.clip.gotoAndStop(dirx+diry*2+3);
ob.xtile = Math.floor(ob.x/game.tileW);
ob.ytile = Math.floor(ob.y/game.tileW);
ob.depth=(ob.yiso-ob.depthshift)*300+(ob.xiso)+1;
ob.clip.swapDepths(ob.depth);

After we have moved the char, detected the collisions with walls and probably placed char near the wall, properties x and y will hold correct position in non-isometric view. Now we only calculate new values for isometric view.

You can download the source fla with all the code and movie set up here.

Posted by 시난

댓글을 달아 주세요

  1. 태양이 바다에 미광을 비추면,나는 너를 생각한다.

    2013.07.29 08:48 [ ADDR : EDIT/ DEL : REPLY ]
  2. 눈을 감아봐 입가에 미소가 떠오르면 네가 사랑하는 그 사람이 널 사랑하고 있는거야.

    2013.08.05 06:38 [ ADDR : EDIT/ DEL : REPLY ]