2016년 9월 1일 목요일

2)ActionFighter and imageDrawing


first of all, Let's see ActionFighter(AF), the most Important thing in BitmapWorld.

AFis blueprintClass heritaged by PaperCharacter.

AF do many thing, but first let's see How it draw Character.


-      CharacterFlipbook


first, let's see How it change characterFlipbook.

2Dcharacter can't move one model by anim, not like 3Dcharacter. in fact It can use like that, I don't like it. so BitmapWorld's AF have each Flipbook on each motion.




It's okay that drawing Image and making Flipbook. but how we can connect this with AF?

simply, we can set Flipbook of AF's Sprite.

Like This.

but we need to think about it deeply. currently we only have BIT, one character. but we can't make Game with only one Character. there are various characters that have each individual Image. and it will change in various situation.

Rather than making each flipbookSetter one by one, Making new component that work only for changing AF's Flipbook. and by this component's function, AF change it's flipbook by it's own flipbook variable.

we need something to that.


FlipbookMotionGuide








FlipbookMotionGuide is enum about all Motion that AF can have.
each AF have Flipbook matching on this motionEnum.

 















AFflipbookComponent



component to change AF's Flipbook.


it look like messy but by this AF can call it's own var and change flipbook. at least we don't need to make this messy thing over and over again.
eventually AF can make different character by changing it's motionFlipbook var.
surely we still need to draw each resource. :(

-      ActionMap

in this Screen, there are almost Images AF need to draw.

as you see, AF have round interface, ActionMap, surrounding it's character.

actionMap have 6 direction's slot and each slot have to show 4type of image.
and each slot image can overlap and show multiply.








now let's make AF draw slot.

slot drawing's programming is focused in AF. In fact CharacterFlipbookChange also in AF and I find about conponent and divide this on component. I think slot drawing also need to divide... but only think.



anyway, slot's drawing work very dynamically.
slot create new PaperSpriteComponent when it need, and draw slot and destroy again. by this, we can draw various slot limitlessly.



CreateSlot

AF's CreateSlot Function craete and save slot on each type's individual slotArray.

it read slotInfo as parameter and calculate how many PaperSpriteComponent need and create(ex. slotinfo = 123 then it make 3 slot) and attach new component to actionMap. by this, slot can draw on actionMap.


DrawSlot
DrawSlot use same slotInfo that used on creating and by this, match resource on right position.
nextSlot type need to draw chargeRate so it also read chargeRate and match resource.

ClearSlotSet
when slot need to be changed or disappear, each SlotsetData all deleted and clear. it clear all slot type togater.




with this, AF draw Character and actionMap.

next, let's see how AF's gameAction work.



댓글 없음:

댓글 쓰기