This article is written by Cartzhang, reproduced please indicate the source. All rights reserved.
Article Link: http://blog.csdn.net/cartzhang/article/details/44939887
Cartzhang
KinectLittle Doll Game----Little DiverI. Description of the game
through Kinect control little dolls to play Unreal game, left right hand lift can move around, right hand raised above the head, can jump up, also can launch snail bullets to attack the small fish. This is achieved using the 2D effect of the UE4 .
A sneak peek at the little protagonist of Meng Meng:
Second, the main implementation of the interface
Header file:
Ufunction (blueprintcallable, Category = kinectue) void handstate (const int32 handtype); Ufunction (blueprintcallable, Category = kinectue) void Startcheckhandspushdrivehand (); Ufunction (blueprintimplementableevent, meta = (FriendlyName = "right Hand Push")) virtual void Righthandpush (); Ufunction (blueprintimplementableevent, meta = (FriendlyName = "left Hand Push")) virtual void Lefthandpush (); Ufunction (blueprintimplementableevent, meta = (FriendlyName = "left Hand Move")) virtual void lefthandmoveleft (); Ufunction (blueprintimplementableevent, meta = (FriendlyName = "right Hand Move")) virtual void righthandmoveright (); void Righthandoverheadforjump ();
Implementation files , CPP files:
void Atwodpapercharacter::handstate (const int32 handtype) {int iflag = udkinecthandsreachoutgesture (0, Handtype); Gengine && Iflag = = 1) {Const float fmovespeed = 1.0f;switch (handtype) {case 1:lefthandmoveleft (); Break;case 2:rig Hthandmoveright (); break;default:break;}}} void Atwodpapercharacter::startcheckhandspushdrivehand () {int irightflag = udkinectrighthandpushgesture (USER_INDEX) if (Irightflag = = 1) {Righthandpush ();} int ileftflag = Udkinectlefthandpushgesture (User_index), if (Ileftflag = = 1) {Lefthandpush ();}} void Atwodpapercharacter::righthandoverheadforjump () {int irighthandoverheadflag = Udkinectrighthandoverheadgesture (0); if (gengine && irighthandoverheadflag = = 1) {fstring tmpstring = "Right Hand + Head now ...";//gengine->ad Donscreendebugmessage ( -1, 5.f, fcolor::red, tmpstring); Jump ();}}
Third, Blueprintimplementation (partial)
where logical control, only show the part. Because there are too many, the functions are complex.
The blueprint for attack.
Below is the control of BP.
Launch a snail missile shooting blueprint.
Four, the game
Mainly include, move around, jump, left launch attack, the right to launch a bullet attack, bitten by the small fish injury level.
from the above two graphs, you can see the small divers by the small fish attack and change the color.
where there are 6 different color transformations depending on the degree of injury.
little divers are firing snail missiles at the left and right, To attack the little fish.
Five, game video
The video has been uploaded to Youku.
The address is as follows: http://v.youku.com/v_show/id_XOTI4NjUyMzIw.html
Kinect Little Super Doll-Little Diver
The end! ---------------
If you have any questions, please feel free to contact us. Thank you so much!
Kinect Little Doll Game----little Diver