>_<:Only a little change in the function of MyPaint(...),besides the initial value have some changes. >_<:resource >_<:code:    #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.…
>_<:Learning the physical engine >_<:resource >_<:code #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <tim…
>_<:Compared with previous talk,there will be taking about how to create an accelerated speed.Only a little change in the MyPaint(...) function. >_<:resource >_<:code #include <windows.h> // C 运行时头文件 #include <stdlib.h> #incl…
>_<:Just the minimum Win32  frame don't have any other special function. //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by FE.RC // #define IDR_MAINFRAME 128 #define IDD_FE_DIALOG 102 #define IDD_ABOUTBOX 103 #define I…
>_<:Learning its AI logic. >_<:resource >_<:code: #include <windows.h> // C 运行时头文件 #include <stdlib.h> #include <cstdio> #include <malloc.h> #include <memory.h> #include <tchar.h> #include <time.h&g…
Box2d中,物体可以接受力(Force).冲量(Impulse)和扭矩(Torque).这些物理元素都能改变物体的运动形式,并且默认都会唤醒物体,当然只是针对动态物体. 力是一个持久的效果,通过Box2d内置的积分器实现运动变化. 冲量是一个瞬时效果,能立马改变其效果. 主要函数: body.applyLinearImpulse( Vector2 impulse, Vector2 position, boolean wakeup ) 第一个参数表示冲量,包含x和y方向的大小. 第二个参数表示施…
打靶游戏:     1.靶对象为 5 环,按环计分:    2.箭对象,射中后要插在靶上:    3.游戏仅一轮,无限 trials: 增强要求:  添加一个风向和强度标志,提高难度 游戏成品图: UML图: 游戏设计思路&大致过程&核心代码 游戏对象主要由三个,靶.弓和箭,射出去的箭可以复用(利用简单工厂),将箭从弓的位置加上常力向某个方向射出.最后实现增强功能——添加常力作为风向并且在界面中显示出风向(只设置了界面上的左右两个不同方向)以及风力(0~50). 1.首先设置游戏对象——靶…
>_<:introduce the functions of define\create\use pen and brush to draw all kinds of line and some graphs. >_<!following 2 files are the same with the previous and file main.cpp has some changes. //{{NO_DEPENDENCIES}} // Microsoft Visual C++ ge…
>_<:use MOUSE_MOVE message refresh the position information. >_<:use LOWORD(lParam) get position x and use HIWORD(lParam) get position y //{{NO_DEPENDENCIES}} // Microsoft Visual C++ generated include file. // Used by FE.RC // #define IDR_MAIN…
>_<:first build some points put in poly1[],poly2[] and poly3[] in the function of InitInstance(...) >_<:then in the function MyDraw() use  PolylineTo(...)\Polyline(...)\Polygon(...) draw diferent line and use PolyBezierTo(...)\PolyBezier(...)…