ScriptGen.cpp
资源名称:g.rar [点击查看]
上传用户:laitongbao
上传日期:2021-02-20
资源大小:8176k
文件大小:1k
源码类别:
射击游戏
开发平台:
Visual C++
- // ScriptGen.cpp : Defines the entry point for the console application.
- //
- #include "stdafx.h"
- #include "stdio.h"
- #include "stdlib.h"
- #include "..includecgl.h"
- #pragma comment(lib,"..\CGLLIB.lib")
- int main(int argc, char* argv[])
- {
- int num = 200;
- FILE * file;
- file = fopen("script.txt","w");
- if(argc == 1)
- num = 200;
- else
- num = atoi(argv[0]);
- RandGenerator rand(23);
- for(int i = 0 ;i<num ;i++ )
- {
- float posx = rand.GetFloat(-100,100);
- float posy = 0;
- float posz = rand.GetFloat(200.f,500.f);
- float vx = rand.GetFloat(-20.f,20.f);
- float vy = 0;
- float vz = rand.GetFloat(-50.f,-60.f);
- fprintf(file,"%i: Enemy1 %f %f %f %f %f %f 0n",i,posx,posy,posz,vx,vy,vz);
- printf("%i: Enemy1 %f %f %f %f %f %f 0n",i,posx,posy,posz,vx,vy,vz);
- }
- fclose(file);
- return 0;
- }