funcode海底世界练习c语言代码参考。
//-----------------------------------------------------------------------------
//
float g_fScreenLeft = 0.f; // 屏幕左边界值
float g_fScreenRight = 0.f; // 右
float g_fScreenTop = 0.f; // 上
float g_fScreenBottom = 0.f; // 下
float g_fSpeedLeft = 0.f; // 左方向速度
float g_fSpeedRight = 0.f; // 右
float g_fSpeedTop = 0.f; // 上
float g_fSpeedBottom = 0.f; // 下
//-----------------------------------------------------------------------------
#include "CommonAPI.h"
#include "LessonX.h"
#include
/// //
// 主函数入口
//
// int PASCAL WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// 初始化游戏引擎
if( !dInitGameEngine( hInstance, lpCmdLine ) )
return 0;
g_fScreenLeft = dGetScreenLeft();
g_fScreenRight = dGetScreenRight();
g_fScreenTop = dGetScreenTop();
g_fScreenBottom = dGetScreenBottom();
for(int i=0; i<4; i++)
{
char szName[128];
sprintf(szName, "fish%d", i); // 注意,szName传入时不能是空指针
}
// To do : 在此使用API更改窗口标题
dSetWindowTitle("Lesson");
dSetSpriteWorldLimit("myfish", WORLD_LIMIT_NULL, g_fScreenLeft, g_fScreenTop,